@@ -16,7 +16,6 @@ def configure(**extra):
1616 defaults = dict (
1717 CACHE_BACKEND = 'locmem:///' ,
1818 DEBUG = True ,
19- TEMPLATE_DEBUG = True ,
2019 DATABASE_SUPPORTS_TRANSACTIONS = True ,
2120 DATABASES = {'default' : config (default = 'sqlite://localhost/hvad.db' )},
2221 TEST_DATABASE_CHARSET = "utf8" ,
@@ -30,20 +29,18 @@ def configure(**extra):
3029 ADMIN_MEDIA_PREFIX = '/static/admin/' ,
3130 EMAIL_BACKEND = 'django.core.mail.backends.locmem.EmailBackend' ,
3231 SECRET_KEY = 'key' ,
33- TEMPLATE_LOADERS = ( # Remove when dropping support for Django 1.7
34- 'django.template.loaders.filesystem.Loader' ,
35- 'django.template.loaders.app_directories.Loader' ,
36- ),
37- TEMPLATE_DIRS = [ # Remove when dropping support for Django 1.7
38- os .path .abspath (os .path .join (os .path .dirname (__file__ ), 'project' , 'templates' ))
39- ],
4032 TEMPLATES = [
4133 {
4234 'BACKEND' : 'django.template.backends.django.DjangoTemplates' ,
4335 'DIRS' : [
4436 os .path .abspath (os .path .join (os .path .dirname (__file__ ), 'project' , 'templates' ))
4537 ],
4638 'APP_DIRS' : True ,
39+ 'OPTIONS' : {
40+ 'context_processors' : [
41+ 'django.contrib.auth.context_processors.auth' ,
42+ ],
43+ }
4744 },
4845 ],
4946 MIDDLEWARE_CLASSES = [
@@ -77,6 +74,21 @@ def configure(**extra):
7774 'django.contrib.auth.hashers.MD5PasswordHasher' ,
7875 )
7976 )
77+ if django .VERSION < (1 , 8 ):
78+ defaults .update (dict (
79+ TEMPLATE_DEBUG = True ,
80+ TEMPLATE_CONTEXT_PROCESSORS = ( # Remove when dropping support for Django 1.7
81+ 'django.contrib.auth.context_processors.auth' ,
82+ ),
83+ TEMPLATE_LOADERS = ( # Remove when dropping support for Django 1.7
84+ 'django.template.loaders.filesystem.Loader' ,
85+ 'django.template.loaders.app_directories.Loader' ,
86+ ),
87+ TEMPLATE_DIRS = [ # Remove when dropping support for Django 1.7
88+ os .path .abspath (os .path .join (os .path .dirname (__file__ ), 'project' , 'templates' ))
89+ ],
90+ ))
91+
8092 defaults .update (extra )
8193 settings .configure (** defaults )
8294 from django .contrib import admin
0 commit comments