summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJelle van der Waa <jelle@vdwaa.nl>2016-10-19 21:44:11 +0200
committerJelle van der Waa <jelle@vdwaa.nl>2017-05-02 21:13:44 +0200
commitaed90d52e36a280264b11a8e8960e4348d5d36fb (patch)
treeaeca1f47ae6aa87c7090009d5f4cd54c491e8dac
parent1d8dd5079526b2855391fb6c6408e474568f28f0 (diff)
downloadarchweb-aed90d52e36a280264b11a8e8960e4348d5d36fb.tar.gz
archweb-aed90d52e36a280264b11a8e8960e4348d5d36fb.zip
Update to django 1.8
Update django, djang-jinja version. Use TEMPLATES = [] to configure the django templates etc. since the old way will be obsolete.
-rw-r--r--requirements.txt6
-rw-r--r--settings.py65
2 files changed, 53 insertions, 18 deletions
diff --git a/requirements.txt b/requirements.txt
index 8128b451..864fac3a 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,12 +1,12 @@
-e git+git://github.com/fredj/cssmin.git@master#egg=cssmin
-Django==1.7.11
+Django==1.8.18
IPy==0.83
-Jinja2==2.7.3
+Jinja2==2.8
Markdown==2.6.2
MarkupSafe==0.23
bencode==1.0
django-countries==3.3
-django-jinja==1.3.3
+django-jinja==2.2.0
jsmin==2.1.1
pgpdump==1.5
pytz>=2015.4
diff --git a/settings.py b/settings.py
index 8043bc4c..2f775f56 100644
--- a/settings.py
+++ b/settings.py
@@ -45,27 +45,62 @@ LOGIN_REDIRECT_URL = '/'
# Set django's User stuff to use our profile model
AUTH_PROFILE_MODULE = 'devel.UserProfile'
+from os import path
+TEMPLATES = [
+ {
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
+ #'DIRS': ['%s/templates' % DEPLOY_PATH],
+ 'DIRS' : [
+ path.join(DEPLOY_PATH, 'templates')
+ ],
+ 'APP_DIRS': True,
+ 'OPTIONS': {
+ 'context_processors': [
+ 'django.contrib.auth.context_processors.auth',
+ 'django.core.context_processors.debug',
+ 'django.contrib.messages.context_processors.messages',
+ 'main.context_processors.secure',
+ ],
+ }
+ },
+ {
+ 'BACKEND': 'django_jinja.backend.Jinja2',
+ 'APP_DIRS': True,
+ 'DIRS' : [
+ path.join(DEPLOY_PATH, 'templates')
+ ],
+ 'OPTIONS': {
+ 'context_processors': [
+ 'django.contrib.auth.context_processors.auth',
+ 'django.core.context_processors.debug',
+ 'django.contrib.messages.context_processors.messages',
+ 'main.context_processors.secure',
+ ],
+ 'match_extension': '.jinja'
+ }
+ }
+]
# We add a processor to determine if the request is secure or not
-TEMPLATE_CONTEXT_PROCESSORS = (
- 'django.contrib.auth.context_processors.auth',
- 'django.core.context_processors.debug',
- 'django.contrib.messages.context_processors.messages',
- 'main.context_processors.secure',
-)
-
-TEMPLATE_DIRS = (
+#TEMPLATE_CONTEXT_PROCESSORS = (
+# 'django.contrib.auth.context_processors.auth',
+# 'django.core.context_processors.debug',
+# 'django.contrib.messages.context_processors.messages',
+# 'main.context_processors.secure',
+#)
+
+#TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates".
# Always use forward slashes, even on Windows.
- '%s/templates' % DEPLOY_PATH,
-)
+# '%s/templates' % DEPLOY_PATH,
+#)
-TEMPLATE_LOADERS = (
- 'django_jinja.loaders.FileSystemLoader',
- 'django_jinja.loaders.AppLoader',
-)
+#TEMPLATE_LOADERS = (
+# 'django_jinja.loaders.FileSystemLoader',
+# 'django_jinja.loaders.AppLoader',
+#)
# Send templates matching the following to the Jinja2 engine
-DEFAULT_JINJA2_TEMPLATE_EXTENSION = '.jinja'
+#DEFAULT_JINJA2_TEMPLATE_EXTENSION = '.jinja'
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',