Permalink
Browse files

BK-317 Change configuration for TEMPLATE_LOADERS

  • Loading branch information...
1 parent 19edbff commit ed44d5e47049bf80340e8e2ab525174c1b16ee79 @aerkalov aerkalov committed Jul 1, 2012
Showing with 16 additions and 7 deletions.
  1. +14 −5 lib/booki/settings.py.original
  2. +2 −2 scripts/createbooki
@@ -130,11 +130,20 @@ SECRET_KEY = 'enc*ln*vp^o2p1p6of8ip9v5_tt6r#fh2-!-@pl0ur^6ul6e)l'
MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'
# List of callables that know how to import templates from various sources.
-TEMPLATE_LOADERS = (
- 'django.template.loaders.filesystem.load_template_source',
- 'django.template.loaders.app_directories.load_template_source',
- 'django.template.loaders.eggs.load_template_source',
-)
+import django
+
+if django.VERSION[1] < 3:
+ TEMPLATE_LOADERS = (
+ 'django.template.loaders.filesystem.load_template_source',
+ 'django.template.loaders.app_directories.load_template_source',
+ 'django.template.loaders.eggs.load_template_source',
+ )
+else:
+ TEMPLATE_LOADERS = (
+ 'django.template.loaders.filesystem.Loader',
+ 'django.template.loaders.app_directories.Loader',
+ 'django.template.loaders.eggs.Loader',
+ )
TEMPLATE_CONTEXT_PROCESSORS = ('django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages')
View
@@ -216,10 +216,10 @@ def create_settings(destination, database):
'BOOKI_ROOT': os.path.abspath(destination)}
if database == 'postgresql':
- vals['DATABASE_ENGINE'] = 'postgresql_psycopg2'
+ vals['DATABASE_ENGINE'] = 'django.db.backends.postgresql_psycopg2'
vals['DATABASE_NAME'] = ''
elif database == 'sqlite':
- vals['DATABASE_ENGINE'] = 'sqlite3'
+ vals['DATABASE_ENGINE'] = 'django.db.backends.sqlite3'
vals['DATABASE_NAME'] = '%s/database.sqlite' % destination
for k in vals.keys():

0 comments on commit ed44d5e

Please sign in to comment.