From 87af9df45a50ab0c0da797498c5336cf47ceb55d Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Mon, 2 Dec 2013 10:27:34 +0100 Subject: [PATCH] settings: activate south with sqlite if FORCE_SOUTH is defined in the environment --- README | 8 ++++++++ polynum/settings.py | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README b/README index 42964a1..ea932bc 100644 --- a/README +++ b/README @@ -130,3 +130,11 @@ MAX_ENTITY_FILTER_DEPTH USE_PDF_VIEWER Utiliser la visionneuse de PDF, par défaut False. + +Environment +----------- + +FORCE_SOUTH + + If this variable is defined in the environment, you can use south with + sqlite. diff --git a/polynum/settings.py b/polynum/settings.py index 4680be0..d421300 100644 --- a/polynum/settings.py +++ b/polynum/settings.py @@ -1,5 +1,6 @@ # Django settings for polynum project. +import os import os.path import django.conf.global_settings as DEFAULT_SETTINGS from django.core.urlresolvers import reverse_lazy @@ -218,7 +219,7 @@ except: pass # use South, unless if database is sqlite3 -if DATABASES['default']['ENGINE'] != 'django.db.backends.sqlite3': +if DATABASES['default']['ENGINE'] != 'django.db.backends.sqlite3' or 'FORCE_SOUTH' in os.environ: INSTALLED_APPS = ('south',) + INSTALLED_APPS # CAS