@@ -16,7 +16,6 @@ def configure(**extra):
16
16
defaults = dict (
17
17
CACHE_BACKEND = 'locmem:///' ,
18
18
DEBUG = True ,
19
- TEMPLATE_DEBUG = True ,
20
19
DATABASE_SUPPORTS_TRANSACTIONS = True ,
21
20
DATABASES = {'default' : config (default = 'sqlite://localhost/hvad.db' )},
22
21
TEST_DATABASE_CHARSET = "utf8" ,
@@ -30,20 +29,18 @@ def configure(**extra):
30
29
ADMIN_MEDIA_PREFIX = '/static/admin/' ,
31
30
EMAIL_BACKEND = 'django.core.mail.backends.locmem.EmailBackend' ,
32
31
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
- ],
40
32
TEMPLATES = [
41
33
{
42
34
'BACKEND' : 'django.template.backends.django.DjangoTemplates' ,
43
35
'DIRS' : [
44
36
os .path .abspath (os .path .join (os .path .dirname (__file__ ), 'project' , 'templates' ))
45
37
],
46
38
'APP_DIRS' : True ,
39
+ 'OPTIONS' : {
40
+ 'context_processors' : [
41
+ 'django.contrib.auth.context_processors.auth' ,
42
+ ],
43
+ }
47
44
},
48
45
],
49
46
MIDDLEWARE_CLASSES = [
@@ -77,6 +74,21 @@ def configure(**extra):
77
74
'django.contrib.auth.hashers.MD5PasswordHasher' ,
78
75
)
79
76
)
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
+
80
92
defaults .update (extra )
81
93
settings .configure (** defaults )
82
94
from django .contrib import admin
0 commit comments