Skip to content

Commit 70bd872

Browse files
author
thecodinghouse
authored
Merge pull request #7 from isaacm/upgrade-to-mezzanine-4.2.3
Upgrade to mezzanine-4.2.3
2 parents 911ea47 + 2d418cc commit 70bd872

File tree

3 files changed

+46
-35
lines changed

3 files changed

+46
-35
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Mezzanine==3.1.10
1+
Mezzanine==4.2.3

settings.py

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -137,20 +137,14 @@
137137
# * Receive x-headers
138138
INTERNAL_IPS = ("127.0.0.1",)
139139

140-
# List of callables that know how to import templates from various sources.
141-
TEMPLATE_LOADERS = (
142-
"django.template.loaders.filesystem.Loader",
143-
"django.template.loaders.app_directories.Loader",
144-
)
145-
146140
AUTHENTICATION_BACKENDS = ("mezzanine.core.auth_backends.MezzanineBackend",)
147141

148142
# List of finder classes that know how to find static files in
149143
# various locations.
150144
STATICFILES_FINDERS = (
151145
"django.contrib.staticfiles.finders.FileSystemFinder",
152146
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
153-
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
147+
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
154148
)
155149

156150
# The numeric mode to set newly-uploaded files to. The value should be
@@ -223,18 +217,51 @@
223217
# or "C:/www/django/templates".
224218
# Always use forward slashes, even on Windows.
225219
# Don't forget to use absolute paths, not relative paths.
226-
TEMPLATE_DIRS = (os.path.join(PROJECT_ROOT, "templates"),)
220+
TEMPLATES = [
221+
{
222+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
223+
'DIRS': [
224+
# insert your TEMPLATE_DIRS here
225+
os.path.join(PROJECT_ROOT, "templates"),
226+
],
227+
'OPTIONS': {
228+
'context_processors': [
229+
# Insert your TEMPLATE_CONTEXT_PROCESSORS here or use this
230+
# list if you haven't customized them:
231+
'django.contrib.auth.context_processors.auth',
232+
'django.template.context_processors.debug',
233+
'django.template.context_processors.i18n',
234+
'django.template.context_processors.media',
235+
'django.template.context_processors.request',
236+
'django.template.context_processors.static',
237+
'django.template.context_processors.tz',
238+
'django.contrib.messages.context_processors.messages',
239+
'mezzanine.pages.context_processors.page',
240+
"mezzanine.conf.context_processors.settings",
241+
"mezzanine.pages.context_processors.page",
242+
],
243+
'loaders': [
244+
# insert your TEMPLATE_LOADERS here
245+
"django.template.loaders.filesystem.Loader",
246+
"django.template.loaders.app_directories.Loader",
247+
],
248+
'builtins': [
249+
'mezzanine.template.loader_tags',
250+
]
251+
},
252+
},
253+
]
227254

228255

229256
################
230257
# APPLICATIONS #
231258
################
232259

233260
INSTALLED_APPS = (
234-
"flat",
235-
#"moderna",
236-
#"nova",
237-
#"solid",
261+
"flat",
262+
#"moderna",
263+
#"nova",
264+
#"solid",
238265
"django.contrib.admin",
239266
"django.contrib.auth",
240267
"django.contrib.contenttypes",
@@ -256,22 +283,6 @@
256283
#"mezzanine.mobile",
257284
)
258285

259-
# List of processors used by RequestContext to populate the context.
260-
# Each one should be a callable that takes the request object as its
261-
# only parameter and returns a dictionary to add to the context.
262-
TEMPLATE_CONTEXT_PROCESSORS = (
263-
"django.contrib.auth.context_processors.auth",
264-
"django.contrib.messages.context_processors.messages",
265-
"django.core.context_processors.debug",
266-
"django.core.context_processors.i18n",
267-
"django.core.context_processors.static",
268-
"django.core.context_processors.media",
269-
"django.core.context_processors.request",
270-
"django.core.context_processors.tz",
271-
"mezzanine.conf.context_processors.settings",
272-
"mezzanine.pages.context_processors.page",
273-
)
274-
275286
# List of middleware classes to use. Order is important; in the request phase,
276287
# these middleware classes will be applied in the order given, and in the
277288
# response phase the middleware will be applied in reverse order.

urls.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import unicode_literals
22

3-
from django.conf.urls import patterns, include, url
3+
from django.conf.urls import include, url
44
from django.conf.urls.i18n import i18n_patterns
55
from django.contrib import admin
66

@@ -13,13 +13,13 @@
1313
# You can also change the ``home`` view to add your own functionality
1414
# to the project's homepage.
1515

16-
urlpatterns = i18n_patterns("",
16+
urlpatterns = i18n_patterns(
1717
# Change the admin prefix here to use an alternate URL for the
1818
# admin interface, which would be marginally more secure.
19-
("^admin/", include(admin.site.urls)),
19+
url("^admin/", include(admin.site.urls)),
2020
)
2121

22-
urlpatterns += patterns('',
22+
urlpatterns += [
2323

2424
# We don't want to presume how your homepage works, so here are a
2525
# few patterns you can use to set it up.
@@ -69,7 +69,7 @@
6969
# ``mezzanine.urls``, go right ahead and take the parts you want
7070
# from it, and use them directly below instead of using
7171
# ``mezzanine.urls``.
72-
("^", include("mezzanine.urls")),
72+
url("^", include("mezzanine.urls")),
7373

7474
# MOUNTING MEZZANINE UNDER A PREFIX
7575
# ---------------------------------
@@ -87,7 +87,7 @@
8787

8888
# ("^%s/" % settings.SITE_PREFIX, include("mezzanine.urls"))
8989

90-
)
90+
]
9191

9292
# Adds ``STATIC_URL`` to the context of error pages, so that error
9393
# pages can use JS, CSS and images.

0 commit comments

Comments
 (0)