Browse Source

Fix deprecation warnings (RemovedInDjango110Warning)

Baptiste Jonglez 8 years ago
parent
commit
246795ce7d
3 changed files with 27 additions and 8 deletions
  1. 21 2
      celutz/settings.py
  2. 3 3
      celutz/urls.py
  3. 3 3
      panorama/urls.py

+ 21 - 2
celutz/settings.py

@@ -22,8 +22,6 @@ SECRET_KEY = 'ei3#@ejlp((&tlx2jrscs^wrvpn$y4o-7_(-$a_uc9%j3eux1*'
 # SECURITY WARNING: don't run with debug turned on in production!
 DEBUG = True
 
-TEMPLATE_DEBUG = True
-
 ALLOWED_HOSTS = []
 
 
@@ -55,6 +53,27 @@ MIDDLEWARE_CLASSES = (
 
 ROOT_URLCONF = 'celutz.urls'
 
+TEMPLATES = [
+    {
+        'BACKEND': 'django.template.backends.django.DjangoTemplates',
+        'DIRS': [],
+        'APP_DIRS': True,
+        'OPTIONS': {
+            'context_processors': [
+                'django.contrib.auth.context_processors.auth',
+                'django.template.context_processors.debug',
+                'django.template.context_processors.request',
+                'django.template.context_processors.i18n',
+                'django.template.context_processors.media',
+                'django.template.context_processors.static',
+                'django.template.context_processors.tz',
+                'django.template.context_processors.csrf',
+                'django.contrib.messages.context_processors.messages',
+            ],
+        },
+    },
+]
+
 WSGI_APPLICATION = 'celutz.wsgi.application'
 
 

+ 3 - 3
celutz/urls.py

@@ -1,13 +1,13 @@
 from django.conf import settings
-from django.conf.urls import patterns, include, url
+from django.conf.urls import include, url
 from django.conf.urls.static import static
 from django.contrib import admin
 
-urlpatterns = patterns('',
+urlpatterns = [
     # Examples:
     # url(r'^$', 'celutz.views.home', name='home'),
     url(r'^admin/', include(admin.site.urls)),
     url(r'^', include('panorama.urls', namespace="panorama")),
     url(r'^api/v1/', include('api.urls')),
 # In debug mode, serve tiles
-) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
+] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

+ 3 - 3
panorama/urls.py

@@ -1,12 +1,12 @@
 # -*- coding: utf-8 -*-
 from __future__ import unicode_literals
 
-from django.conf.urls import patterns, include, url
+from django.conf.urls import include, url
 
 from .views import PanoramaUpload, PanoramaView, PanoramaList, PanoramaGenTiles, LocatePointView, LocateReferencePointView, LocateCustomPointView
 
 
-urlpatterns = patterns('',
+urlpatterns = [
     url(r'^$', PanoramaList.as_view(), name="list"),
     url(r'^locate/$', LocatePointView.as_view(), name="locate"),
     url(r'^locate/refpoint/$', LocateReferencePointView.as_view(), name="locate_refpoint"),
@@ -14,4 +14,4 @@ urlpatterns = patterns('',
     url(r'^pano/new/$', PanoramaUpload.as_view(), name="new"),
     url(r'^pano/view/(?P<pk>\d+)/$', PanoramaView.as_view(), name="view_pano"),
     url(r'^pano/gen_tiles/(?P<pk>\d+)/$', PanoramaGenTiles.as_view(), name="gen_tiles"),
-)
+]