]> git.parisson.com Git - mezzo.git/commitdiff
fix deprecated in 1.10
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Wed, 9 Mar 2016 23:57:16 +0000 (00:57 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Wed, 9 Mar 2016 23:57:16 +0000 (00:57 +0100)
app/festival/urls.py
app/sandbox/settings.py
app/sandbox/urls.py

index ffed233f75b6a63cae3aa32e2cd2964664ab0ad3..686b4770b5572fd9c96ee31596807eb79706f6ff 100644 (file)
@@ -9,10 +9,9 @@ from mezzanine.conf import settings
 
 from festival.views import *
 
-urlpatterns = patterns('',
+urlpatterns = [
     url(r'^artists/$', ArtistListView.as_view(), name="festival-artist-list"),
     url(r'^artists/(?P<slug>.*)/$', ArtistDetailView.as_view(), name="festival-artist-detail"),
     url(r'^videos/$', VideoListView.as_view(), name="festival-video-list"),
     url(r'^videos/(?P<slug>.*)/$', VideoDetailView.as_view(), name="festival-video-detail"),
-
-)
+]
index 0043e1707b55fa2fd6903ec9e8bfd232b0276ee7..a0b6f7bd9479b76d42850c82688f87bfa661a595 100644 (file)
@@ -186,12 +186,6 @@ MEDIA_ROOT = '/srv/media/'
 # Package/module name to import the root urlpatterns from for the project.
 ROOT_URLCONF = "%s.urls" % PROJECT_APP
 
-# Put strings here, like "/home/html/django_templates"
-# or "C:/www/django/templates".
-# Always use forward slashes, even on Windows.
-# Don't forget to use absolute paths, not relative paths.
-TEMPLATE_DIRS = (os.path.join(PROJECT_ROOT, "templates"),)
-
 
 ################
 # APPLICATIONS #
@@ -238,21 +232,21 @@ MODELTRANSLATION_TRANSLATION_FILES = (
     'translations',
 )
 
-# List of processors used by RequestContext to populate the context.
-# Each one should be a callable that takes the request object as its
-# only parameter and returns a dictionary to add to the context.
-TEMPLATE_CONTEXT_PROCESSORS = (
-    "django.contrib.auth.context_processors.auth",
-    "django.contrib.messages.context_processors.messages",
-    "django.core.context_processors.debug",
-    "django.core.context_processors.i18n",
-    "django.core.context_processors.static",
-    "django.core.context_processors.media",
-    "django.core.context_processors.request",
-    "django.core.context_processors.tz",
-    "mezzanine.conf.context_processors.settings",
-    "mezzanine.pages.context_processors.page",
-)
+
+TEMPLATES = [{'APP_DIRS': True,
+               'BACKEND': 'django.template.backends.django.DjangoTemplates',
+               'DIRS': ('/srv/app/templates',),
+               'OPTIONS': {'builtins': ['mezzanine.template.loader_tags'],
+                           'context_processors': ('django.contrib.auth.context_processors.auth',
+                                                  'django.contrib.messages.context_processors.messages',
+                                                  'django.core.context_processors.debug',
+                                                  'django.core.context_processors.i18n',
+                                                  'django.core.context_processors.static',
+                                                  'django.core.context_processors.media',
+                                                  'django.core.context_processors.request',
+                                                  'django.core.context_processors.tz',
+                                                  'mezzanine.conf.context_processors.settings',
+                                                  'mezzanine.pages.context_processors.page')}}]
 
 # List of middleware classes to use. Order is important; in the request phase,
 # these middleware classes will be applied in the order given, and in the
index a5836b717ff7f7ba464b03e76b50c5a94b1e7a30..d253e00b15b8fcaa5fe00e518eb19897334ffd41 100644 (file)
@@ -1,5 +1,6 @@
 from __future__ import unicode_literals
 
+import django.views.i18n
 from django.conf.urls import patterns, include, url
 from django.conf.urls.i18n import i18n_patterns
 from django.contrib import admin
@@ -13,18 +14,19 @@ admin.autodiscover()
 # You can also change the ``home`` view to add your own functionality
 # to the project's homepage.
 
-urlpatterns = i18n_patterns("",
+urlpatterns = [
     # Change the admin prefix here to use an alternate URL for the
     # admin interface, which would be marginally more secure.
-    ("^admin/", include(admin.site.urls)),
-)
+    url("^admin/", include(admin.site.urls)),
+    ]
 
 if settings.USE_MODELTRANSLATION:
-    urlpatterns += patterns('',
-        url('^i18n/$', 'django.views.i18n.set_language', name='set_language'),
-    )
+    urlpatterns += [
+        url('^i18n/$', django.views.i18n.set_language, name='set_language'),
+        ]
 
-urlpatterns += patterns('',
+
+urlpatterns += [
     url(r'^festival/', include('festival.urls')),
     url("^%s/" % settings.EVENT_SLUG, include("mezzanine_agenda.urls")),
 
@@ -79,7 +81,7 @@ urlpatterns += patterns('',
     # ``mezzanine.urls``, go right ahead and take the parts you want
     # from it, and use them directly below instead of using
     # ``mezzanine.urls``.
-    ("^", include("mezzanine.urls")),
+    url("^", include("mezzanine.urls")),
 
     # MOUNTING MEZZANINE UNDER A PREFIX
     # ---------------------------------
@@ -96,7 +98,7 @@ urlpatterns += patterns('',
     # need to use the ``SITE_PREFIX`` setting as well.
 
     # ("^%s/" % settings.SITE_PREFIX, include("mezzanine.urls"))
-)
+]
 
 # Adds ``STATIC_URL`` to the context of error pages, so that error
 # pages can use JS, CSS and images.