]> git.sommitrealweird.co.uk Git - sommitrealweird.git/commitdiff
Fix up for django 1.10
authorBrett Parker <iDunno@sommitrealweird.co.uk>
Thu, 22 Jun 2017 13:32:06 +0000 (14:32 +0100)
committerBrett Parker <iDunno@sommitrealweird.co.uk>
Thu, 22 Jun 2017 13:32:06 +0000 (14:32 +0100)
17 files changed:
.gitignore
sommitrealweird/blog/migrations/0001_initial.py [new file with mode: 0644]
sommitrealweird/blog/migrations/__init__.py [new file with mode: 0644]
sommitrealweird/blog/models.py
sommitrealweird/blog/templates/blog/blog_index.html
sommitrealweird/blog/templates/blog/single_entry_rst.html
sommitrealweird/blog/urls.py
sommitrealweird/blog/views.py
sommitrealweird/bpcms/migrations/0001_initial.py [new file with mode: 0644]
sommitrealweird/bpcms/migrations/__init__.py [new file with mode: 0644]
sommitrealweird/bpcms/models.py
sommitrealweird/bpcms/urls.py
sommitrealweird/bpcms/views.py
sommitrealweird/photo/migrations/0001_initial.py [new file with mode: 0644]
sommitrealweird/photo/migrations/__init__.py [new file with mode: 0644]
sommitrealweird/settings.py
sommitrealweird/urls.py

index bbb7c87467387600d585a1831a1200edcae1dfb7..acbc6d8ca136945a6b89b1b6ad5cb7c60c42cdd4 100644 (file)
@@ -1,6 +1,7 @@
 *.py[oc]
 /sommitrealweird.db
 /sommitrealweird/localsettings.py
 *.py[oc]
 /sommitrealweird.db
 /sommitrealweird/localsettings.py
+/media/admin
 /media/photos
 /media/thumbs
 /tmp
 /media/photos
 /media/thumbs
 /tmp
diff --git a/sommitrealweird/blog/migrations/0001_initial.py b/sommitrealweird/blog/migrations/0001_initial.py
new file mode 100644 (file)
index 0000000..7f42c9e
--- /dev/null
@@ -0,0 +1,44 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.10.7 on 2017-06-22 09:40
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    initial = True
+
+    dependencies = [
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='BlogEntry',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('title', models.CharField(max_length=150)),
+                ('islive', models.BooleanField(default=False)),
+                ('format', models.CharField(choices=[(b'rst', b'reStructuredText'), (b'html', b'HTML')], max_length=10)),
+                ('slug', models.SlugField()),
+                ('publish_date', models.DateTimeField()),
+                ('content', models.TextField()),
+            ],
+            options={
+                'ordering': ['-publish_date'],
+            },
+        ),
+        migrations.CreateModel(
+            name='BlogSection',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('title', models.CharField(max_length=150)),
+                ('slug', models.SlugField()),
+            ],
+        ),
+        migrations.AddField(
+            model_name='blogentry',
+            name='sections',
+            field=models.ManyToManyField(to='blog.BlogSection'),
+        ),
+    ]
diff --git a/sommitrealweird/blog/migrations/__init__.py b/sommitrealweird/blog/migrations/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
index fa2e954f49e8319a031b93a3ea5174c758eab730..9548a32b5b2a4fc1c445109c0292cd9a0b516fa3 100644 (file)
@@ -1,4 +1,3 @@
-from django.contrib.comments.moderation import CommentModerator, moderator
 from django.db import models
 from django.conf import settings
 from django.contrib import admin
 from django.db import models
 from django.conf import settings
 from django.contrib import admin
@@ -29,17 +28,6 @@ class BlogEntry(models.Model):
     class Meta:
         ordering = ['-publish_date']
 
     class Meta:
         ordering = ['-publish_date']
 
-class BlogEntryCommentModerator(CommentModerator):
-    email_notification = True
-
-    def moderate(self, comment, content_object, request):
-        if request.user.is_authenticated():
-            return False
-        else:
-            return True
-
-moderator.register(BlogEntry, BlogEntryCommentModerator)
-
 class BlogSection(models.Model):
     title = models.CharField(max_length=150)
     slug = models.SlugField()
 class BlogSection(models.Model):
     title = models.CharField(max_length=150)
     slug = models.SlugField()
index 950e4cd94acfc41e5516b7a2559ac0f794868410..f2ede847ed3117dfc7a9e1b96c191d6c1e67bad5 100644 (file)
@@ -1,6 +1,5 @@
 {% extends "base.html" %}
 {% load xhtml11rst %}
 {% extends "base.html" %}
 {% load xhtml11rst %}
-{% load comments %}
 
 {% block extrahead %}
 <link rel="alternate" type="application/atom+xml" title="iDunno's Blog - Atom Feed" href="{{ BLOG_FEED_ROOT }}" />
 
 {% block extrahead %}
 <link rel="alternate" type="application/atom+xml" title="iDunno's Blog - Atom Feed" href="{{ BLOG_FEED_ROOT }}" />
@@ -26,8 +25,7 @@
                         {% endif %}
                     {% endif %}
                 {% endfor %}
                         {% endif %}
                     {% endif %}
                 {% endfor %}
-                {% get_comment_count for entry as comment_count %}
-                | <a href="{{ entry.get_absolute_url }}">permalink</a> | <a href="{{ entry.get_absolute_url }}#comments">Comments</a>: {{ comment_count }}</p>
+                | <a href="{{ entry.get_absolute_url }}">permalink</a></p>
         {% endfor %}
         {% if paginated and has_more_than_one_page %}
             <p class="paginator">Pages: 
         {% endfor %}
         {% if paginated and has_more_than_one_page %}
             <p class="paginator">Pages: 
index 5dd425887808e143ac15ada4595dd57c1a31a650..695df776257a034672425a962163e783c4ffffcc 100644 (file)
@@ -1,7 +1,6 @@
 {% extends "base.html" %}
 
 {% load xhtml11rst %}
 {% extends "base.html" %}
 
 {% load xhtml11rst %}
-{% load comments %}
 
 {%block title %}{{ entry.title }}{% endblock %}
 
 
 {%block title %}{{ entry.title }}{% endblock %}
 
         {% endif %}
     {% endfor %}
     {% endif %}
         {% endif %}
     {% endfor %}
     {% endif %}
-    {% get_comment_count for entry as comment_count %}
-    | <a href="{{ entry.get_absolute_url }}">permalink</a> | Comments: {{ comment_count }}
+    | <a href="{{ entry.get_absolute_url }}">permalink</a>
 </p>
 </p>
-{% if comment_count %}
-    <div class="comments">
-    <a name="comments"></a>
-    {% get_comment_list for entry as comment_list %}
-    {% for comment in comment_list %}
-    <div class="comment">
-        <h3>{{ comment.user_name }} - {{ comment.submit_date|date:"Y-m-d H:i" }}</h3>
-        {{ comment.comment }}
-    </div>
-    {% endfor %}
-    </div>
-{% endif %}
-<div class="comment_new">
-    {% render_comment_form for entry %}
-</div>
 {% endblock %}
 {% endblock %}
index 19678eb6d1c31bc23f62ecfb67c86c4229e2e8f8..eeeb25be827f69b892a6aeea1c58641faf260309 100644 (file)
@@ -1,13 +1,14 @@
-from django.conf.urls import patterns
+from django.conf.urls import url
+import blog.views
 from settings import MEDIA_ROOT, MEDIA_URL
 
 from settings import MEDIA_ROOT, MEDIA_URL
 
-urlpatterns = patterns('',
-    (r'^(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/(?P<day>[0-9]{2})/(?P<slug>[^/]+)(/|)$', 'blog.views.blog_view'),
-    (r'^(?P<year>[0-9]{4})(?P<month>[0-9]{2})(?P<day>[0-9]{2})-(?P<slug>[^/]+)\.html$', 'blog.views.blog_view'),
-    (r'^(?P<year>[0-9]{4})(?P<month>[0-9]{2})(?P<day>[0-9]{2})(?P<hour>[0-9]{2})(?P<minutes>[0-9]{2})-(?P<slug>[^/]+)\.html$', 'blog.views.blog_view'),
-    (r'^(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/(?P<day>[0-9]{2})/$', 'blog.views.blog_view'),
-    (r'^(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/$', 'blog.views.blog_view'),
-    (r'^(?P<year>[0-9]{4})/$', 'blog.views.blog_view'),
-    (r'^section/(?P<section>[^/]*)/$', 'blog.views.blog_index'),
-    (r'^$', 'blog.views.blog_index'),
-)
+urlpatterns = [
+    url(r'^(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/(?P<day>[0-9]{2})/(?P<slug>[^/]+)(/|)$', blog.views.blog_view),
+    url(r'^(?P<year>[0-9]{4})(?P<month>[0-9]{2})(?P<day>[0-9]{2})-(?P<slug>[^/]+)\.html$', blog.views.blog_view),
+    url(r'^(?P<year>[0-9]{4})(?P<month>[0-9]{2})(?P<day>[0-9]{2})(?P<hour>[0-9]{2})(?P<minutes>[0-9]{2})-(?P<slug>[^/]+)\.html$', blog.views.blog_view),
+    url(r'^(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/(?P<day>[0-9]{2})/$', blog.views.blog_view),
+    url(r'^(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/$', blog.views.blog_view),
+    url(r'^(?P<year>[0-9]{4})/$', blog.views.blog_view),
+    url(r'^section/(?P<section>[^/]*)/$', blog.views.blog_index),
+    url(r'^$', blog.views.blog_index),
+]
index 09ff5e4132e12e21a4102434aa0cd28bdac73a5d..52fab007886f526b770234b5e2897b64ed4d0bdc 100644 (file)
@@ -1,5 +1,6 @@
 from blog.models import BlogEntry, BlogSection
 from django.http import Http404, HttpResponse
 from blog.models import BlogEntry, BlogSection
 from django.http import Http404, HttpResponse
+from django.shortcuts import render
 from django.template import RequestContext, loader
 from django.core.paginator import Paginator
 from django.conf import settings
 from django.template import RequestContext, loader
 from django.core.paginator import Paginator
 from django.conf import settings
@@ -19,9 +20,7 @@ def blog_index(request, section=None):
         try:
             paginated_entries = paginator.page(page)
             pages = paginator.page_range
         try:
             paginated_entries = paginator.page(page)
             pages = paginator.page_range
-            t = loader.get_template("blog/blog_index.html")
-            c = RequestContext(request,
-                {
+            c = {
                     "entries": paginated_entries.object_list,
                     "title": settings.BLOG_TITLE,
                     "page": page,
                     "entries": paginated_entries.object_list,
                     "title": settings.BLOG_TITLE,
                     "page": page,
@@ -32,8 +31,8 @@ def blog_index(request, section=None):
                     "has_prev": paginated_entries.has_previous(),
                     "next": page + 1,
                     "prev": page - 1
                     "has_prev": paginated_entries.has_previous(),
                     "next": page + 1,
                     "prev": page - 1
-                })
-            return HttpResponse(t.render(c))
+                }
+            return render(request, 'blog/blog_index.html', c)
         except:
             raise Http404
     else:
         except:
             raise Http404
     else:
@@ -49,14 +48,11 @@ def blog_view(request, year=None, month=None, day=None, hour=None, minutes=None,
             try:
                 blog_entry = BlogEntry.objects.get(publish_date__year=year, publish_date__month=month, publish_date__day=day, slug__exact=slug)
                 template_name = "blog/single_entry_%s.html" %(blog_entry.format,)
             try:
                 blog_entry = BlogEntry.objects.get(publish_date__year=year, publish_date__month=month, publish_date__day=day, slug__exact=slug)
                 template_name = "blog/single_entry_%s.html" %(blog_entry.format,)
-                t = loader.get_template(template_name)
-                c = RequestContext(request,
-                    {
+                c = {
                         "entry": blog_entry,
                         "publish_date": blog_entry.publish_date
                     }
                         "entry": blog_entry,
                         "publish_date": blog_entry.publish_date
                     }
-                )
-                return HttpResponse(t.render(c))
+                return render(request, template_name, c)
             except:
                 raise Http404
     else:
             except:
                 raise Http404
     else:
@@ -84,9 +80,7 @@ def blog_view(request, year=None, month=None, day=None, hour=None, minutes=None,
             try:
                 paginated_entries = paginator.page(page)
                 pages = paginator.page_range
             try:
                 paginated_entries = paginator.page(page)
                 pages = paginator.page_range
-                t = loader.get_template("blog/blog_index.html")
-                c = RequestContext(request,
-                    {
+                c = {
                         "entries": paginated_entries.object_list,
                         "title": settings.BLOG_TITLE,
                         "page": page,
                         "entries": paginated_entries.object_list,
                         "title": settings.BLOG_TITLE,
                         "page": page,
@@ -97,8 +91,8 @@ def blog_view(request, year=None, month=None, day=None, hour=None, minutes=None,
                         "has_prev": paginated_entries.has_previous(),
                         "next": page + 1,
                         "prev": page - 1
                         "has_prev": paginated_entries.has_previous(),
                         "next": page + 1,
                         "prev": page - 1
-                    })
-                return HttpResponse(t.render(c))
+                    }
+                return render(request, "blog/blog_index.html", c)
             except:
                 raise Http404
         else:
             except:
                 raise Http404
         else:
diff --git a/sommitrealweird/bpcms/migrations/0001_initial.py b/sommitrealweird/bpcms/migrations/0001_initial.py
new file mode 100644 (file)
index 0000000..0671562
--- /dev/null
@@ -0,0 +1,55 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.10.7 on 2017-06-22 09:39
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+    initial = True
+
+    dependencies = [
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='CSSDocument',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('title', models.CharField(max_length=150)),
+                ('slug', models.SlugField()),
+                ('content', models.TextField()),
+            ],
+        ),
+        migrations.CreateModel(
+            name='Document',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('title', models.CharField(max_length=150)),
+                ('islive', models.BooleanField(default=False)),
+                ('format', models.CharField(choices=[(b'rst', b'reStructuredText'), (b'html', b'HTML')], max_length=10)),
+                ('slug', models.SlugField()),
+                ('content', models.TextField()),
+                ('extracss', models.ManyToManyField(blank=True, null=True, to='bpcms.CSSDocument')),
+            ],
+            options={
+                'ordering': ['folder'],
+            },
+        ),
+        migrations.CreateModel(
+            name='Folder',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('title', models.CharField(max_length=150)),
+                ('slug', models.SlugField()),
+                ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='bpcms.Folder')),
+            ],
+        ),
+        migrations.AddField(
+            model_name='document',
+            name='folder',
+            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='bpcms.Folder'),
+        ),
+    ]
diff --git a/sommitrealweird/bpcms/migrations/__init__.py b/sommitrealweird/bpcms/migrations/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
index 38f18ffe47b400d68327ebcf73535d3fbb0130cd..64939028a26fa30237d7edbf78802c7bc0f2cfdb 100644 (file)
@@ -66,14 +66,14 @@ class Document(models.Model):
     def get_absolute_url(self):
         if self.slug == 'index':
             if self.folder.parent:
     def get_absolute_url(self):
         if self.slug == 'index':
             if self.folder.parent:
-                return reverse('bpcms.views.document_view', kwargs={'folders': self.folder.parent.get_path(), 'slug': self.folder.slug})
+                return reverse('bpcms-document-view', kwargs={'folders': self.folder.parent.get_path(), 'slug': self.folder.slug})
             else:
             else:
-                return reverse('bpcms.views.document_view', kwargs={'slug': self.folder.slug})
+                return reverse('bpcms-document-view', kwargs={'slug': self.folder.slug})
         else:
             if self.folder:
         else:
             if self.folder:
-                return reverse('bpcms.views.document_view', kwargs={'folders': self.get_folder_path(), 'slug': self.slug})
+                return reverse('bpcms-document-view', kwargs={'folders': self.get_folder_path(), 'slug': self.slug})
             else:
             else:
-                return reverse('bpcms.views.document_view', kwargs={'slug': self.slug})
+                return reverse('bpcms-document-view', kwargs={'slug': self.slug})
 
 class Folder(models.Model):
     title = models.CharField(max_length=150)
 
 class Folder(models.Model):
     title = models.CharField(max_length=150)
@@ -106,6 +106,6 @@ class Folder(models.Model):
 
     def get_absolute_url(self):
         if self.parent:
 
     def get_absolute_url(self):
         if self.parent:
-            return reverse('bpcms.views.document_view', kwargs={'folders': self.parent.get_path(), 'slug': self.slug})
+            return reverse('bpcms-document-view', kwargs={'folders': self.parent.get_path(), 'slug': self.slug})
         else:
         else:
-            return reverse('bpcms.views.document_view', kwargs={'slug': self.slug})
+            return reverse('bpcms-document-view', kwargs={'slug': self.slug})
index 2d24d30236124a39ba983a142485b243b6a51da2..1a9111f3183e406acef207b3a789071414a80a06 100644 (file)
@@ -1,9 +1,10 @@
-from django.conf.urls import patterns
+from django.conf.urls import url
+import bpcms.views
 
 
-urlpatterns = patterns('',
-    (r'^$', 'bpcms.views.document_view', {'slug': 'index'}),
-    (r'^css-docs/(?P<slug>[^/]+)$', 'bpcms.views.css_view'),
-    (r'^(?P<slug>[^/]+)/$', 'bpcms.views.document_view'),
-    (r'^(?P<folders>.*)/(?P<slug>[^/]+)/$', 'bpcms.views.document_view'),
-)
+urlpatterns = [
+    url(r'^$', bpcms.views.document_view, {'slug': 'index'}, name='bpcms-document-view'),
+    url(r'^css-docs/(?P<slug>[^/]+)$', bpcms.views.css_view),
+    url(r'^(?P<slug>[^/]+)/$', bpcms.views.document_view, name='bpcms-document-view'),
+    url(r'^(?P<folders>.*)/(?P<slug>[^/]+)/$', bpcms.views.document_view, name='bpcms-document-view'),
+]
 
 
index 9cb3e42e031b7ce7162df2a05a81bbc139dd2c68..0396bf8501325392fdabb4cb6638c0163edcec36 100644 (file)
@@ -1,5 +1,6 @@
 from bpcms.models import CSSDocument, Document, Folder
 from bpcms.models import CSSDocument, Document, Folder
-from django.http import Http404, HttpResponse
+from django.http import Http404
+from django.shortcuts import render
 from django.template import RequestContext, loader
 
 def document_view(request, slug=None, folders=None):
 from django.template import RequestContext, loader
 
 def document_view(request, slug=None, folders=None):
@@ -57,14 +58,12 @@ def document_view(request, slug=None, folders=None):
             except:
                 raise Http404
     template_name = "bpcms/%s.html" %(doc.format,)
             except:
                 raise Http404
     template_name = "bpcms/%s.html" %(doc.format,)
-    t = loader.get_template(template_name)
-    c = RequestContext(request,
-        {
+    c = {
             "content"   : doc.content,
             "title"     : doc.title,
             "extracss"  : doc.extracss.all(),
             "content"   : doc.content,
             "title"     : doc.title,
             "extracss"  : doc.extracss.all(),
-        })
-    return HttpResponse(t.render(c))
+        }
+    return render(request, template_name, c)
 
 def css_view(request, slug):
     cssdoc = CSSDocument.objects.get(slug=slug)
 
 def css_view(request, slug):
     cssdoc = CSSDocument.objects.get(slug=slug)
@@ -72,4 +71,4 @@ def css_view(request, slug):
         raise Http404()
 
     return HttpResponse(cssdoc.content, content_type="text/css")
         raise Http404()
 
     return HttpResponse(cssdoc.content, content_type="text/css")
-    
+
diff --git a/sommitrealweird/photo/migrations/0001_initial.py b/sommitrealweird/photo/migrations/0001_initial.py
new file mode 100644 (file)
index 0000000..d42465c
--- /dev/null
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.10.7 on 2017-06-22 09:40
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+import photo.models
+
+
+class Migration(migrations.Migration):
+
+    initial = True
+
+    dependencies = [
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='Album',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('name', models.CharField(max_length=120)),
+                ('caption', models.TextField(blank=True, null=True)),
+                ('slug', models.SlugField()),
+            ],
+        ),
+        migrations.CreateModel(
+            name='Photo',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('image', models.ImageField(null=True, upload_to=photo.models.get_upload_path)),
+                ('caption', models.TextField(blank=True, null=True)),
+                ('order', models.IntegerField(blank=True, null=True)),
+                ('album', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='photo.Album')),
+            ],
+        ),
+    ]
diff --git a/sommitrealweird/photo/migrations/__init__.py b/sommitrealweird/photo/migrations/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
index 723ff4d0eda2fd31e96379c2f708a76d1be2665a..70594da3096d7a5ff2c51baf8121f3864c086549 100644 (file)
@@ -50,15 +50,10 @@ SECRET_KEY = [random.choice(key_chars) for a in range(0,50)]
 CACHES = {
     'default': {
         'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
 CACHES = {
     'default': {
         'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
-         'LOCATION': '%s/tmp' %(topdir),
+        'LOCATION': '%s/tmp' %(topdir),
     }
 }
 
     }
 }
 
-TEMPLATE_LOADERS = (
-    'django.template.loaders.filesystem.Loader',
-    'django.template.loaders.app_directories.Loader',
-)
-
 MIDDLEWARE_CLASSES = (
     'django.middleware.common.CommonMiddleware',
     'django.contrib.sessions.middleware.SessionMiddleware',
 MIDDLEWARE_CLASSES = (
     'django.middleware.common.CommonMiddleware',
     'django.contrib.sessions.middleware.SessionMiddleware',
@@ -70,9 +65,28 @@ MIDDLEWARE_CLASSES = (
 
 ROOT_URLCONF = 'urls'
 
 
 ROOT_URLCONF = 'urls'
 
-TEMPLATE_DIRS = (
-    os.path.join(topdir, 'templates'),
-)
+TEMPLATES = [
+    {
+        'BACKEND': 'django.template.backends.django.DjangoTemplates',
+        'DIRS': [os.path.join(topdir, 'templates'),],
+        'APP_DIRS': True,
+        'OPTIONS': {
+            'context_processors': [
+                'django.contrib.auth.context_processors.auth',
+                'django.template.context_processors.debug',
+                'django.template.context_processors.i18n',
+                'django.template.context_processors.media',
+                'bpcms.context_processors.content_menu',
+                'bpcms.context_processors.content_submenu',
+                'bpcms.context_processors.content_breadcrumb',
+                'blog.context_processors.content_breadcrumb',
+                'blog.context_processors.blog_feed',
+                'photo.context_processors.content_breadcrumb',
+            ],
+            'debug': True,
+        },
+    },
+]
 
 INSTALLED_APPS = (
     'django.contrib.auth',
 
 INSTALLED_APPS = (
     'django.contrib.auth',
@@ -80,25 +94,12 @@ INSTALLED_APPS = (
     'django.contrib.sessions',
     'django.contrib.sites',
     'django.contrib.admin',
     'django.contrib.sessions',
     'django.contrib.sites',
     'django.contrib.admin',
-    'django.contrib.comments',
     'bpcms',
     'generic',
     'blog',
     'photo',
 )
 
     'bpcms',
     'generic',
     'blog',
     'photo',
 )
 
-TEMPLATE_CONTEXT_PROCESSORS = (
-    'django.contrib.auth.context_processors.auth',
-    'django.core.context_processors.debug',
-    'django.core.context_processors.i18n',
-    'generic.context_processors.media',
-    'bpcms.context_processors.content_menu',
-    'bpcms.context_processors.content_submenu',
-    'bpcms.context_processors.content_breadcrumb',
-    'blog.context_processors.content_breadcrumb',
-    'blog.context_processors.blog_feed',
-    'photo.context_processors.content_breadcrumb',
-)
 
 APPEND_SLASH=False
 
 
 APPEND_SLASH=False
 
index 6c9c00621bbc13a04da8bc5581d79bb6c1e2b5ac..0a4b5f3a2c36d9d27e9eb3b446b3812f8a7b7550 100644 (file)
@@ -1,6 +1,8 @@
 from django.conf.urls import include, url
 from django.conf.urls.static import static
 from django.conf.urls import include, url
 from django.conf.urls.static import static
-from settings import MEDIA_ROOT, MEDIA_URL
+import bpcms.views
+import django.views.static
+from settings import MEDIA_ROOT, MEDIA_URL, STATIC_URL
 from blog.feeds import LatestBlogEntries, LatestBlogEntriesRss
 from django.contrib import admin
 
 from blog.feeds import LatestBlogEntries, LatestBlogEntriesRss
 from django.contrib import admin
 
@@ -21,15 +23,14 @@ urlpatterns = [
     # (r'^sommitrealweird/', include('sommitrealweird.foo.urls')),
 
     # Uncomment this for admin:
     # (r'^sommitrealweird/', include('sommitrealweird.foo.urls')),
 
     # Uncomment this for admin:
-    url(r'^$', 'bpcms.views.document_view', {'slug': 'index'}),
-    url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': MEDIA_ROOT, 'show_indexes': True}),
+    url(r'^$', bpcms.views.document_view, {'slug': 'index'}),
+    url(r'^media/(?P<path>.*)$', django.views.static.serve, {'document_root': MEDIA_ROOT, 'show_indexes': True}),
     url(r'^admin/', include(admin.site.urls)),
     url(r'^blog/', include('blog.urls')),
     url(r'^photo/', include('photo.urls')),
     #url(r'^photos/', include('photo.urls')),
     url(r'^admin/', include(admin.site.urls)),
     url(r'^blog/', include('blog.urls')),
     url(r'^photo/', include('photo.urls')),
     #url(r'^photos/', include('photo.urls')),
-    url(r'^css-doc/(?P<slug>.*)$', 'bpcms.views.css_view'),
+    url(r'^css-doc/(?P<slug>.*)$', bpcms.views.css_view),
     url(r'^feeds/rss/blog/', LatestBlogEntriesRss()),
     url(r'^feeds/blog/', LatestBlogEntries()),
     url(r'^feeds/rss/blog/', LatestBlogEntriesRss()),
     url(r'^feeds/blog/', LatestBlogEntries()),
-    url(r'^comments/', include('django.contrib.comments.urls')),
     url(r'^', include('bpcms.urls'))
     url(r'^', include('bpcms.urls'))
-] + static(MEDIA_URL, MEDIA_ROOT)
+] + static(STATIC_URL, document_root=MEDIA_ROOT)