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"),
-
-)
+]
# 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 #
'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
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
# 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")),
# ``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
# ---------------------------------
# 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.