summaryrefslogtreecommitdiff
path: root/example_project
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-08-20 11:38:44 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-08-20 11:38:44 +0200
commit68ecbb64874a61675fb8856701b9ac4ca14c8e0a (patch)
tree150d0cb94a6fd5cea8e13e94f64c1eb024d975cd /example_project
parentf58aa8293e992f8a666823f81df8d99af5cd4ef6 (diff)
downloadIshtar-68ecbb64874a61675fb8856701b9ac4ca14c8e0a.tar.bz2
Ishtar-68ecbb64874a61675fb8856701b9ac4ca14c8e0a.zip
Celery: add explicit import
Diffstat (limited to 'example_project')
-rw-r--r--example_project/settings.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/example_project/settings.py b/example_project/settings.py
index d7ecb4254..3af5312ce 100644
--- a/example_project/settings.py
+++ b/example_project/settings.py
@@ -292,6 +292,17 @@ except ImportError as e:
except ImportError as e:
print('Unable to load local_settings.py:', e)
+if "SECRET_KEY" not in globals(): # explicit import from the root for celery
+ current_path = os.path.abspath(__file__)
+ current_dir_path = os.path.dirname(current_path).split(os.sep)[-1]
+ my_module = import_module(current_dir_path + ".local_settings")
+ module_dict = my_module.__dict__
+ try:
+ to_import = my_module.__all__
+ except AttributeError:
+ to_import = [name for name in module_dict if not name.startswith('_')]
+ globals().update({name: module_dict[name] for name in to_import})
+
if LANGUAGE_CODE == "fr-fr" and SRID == 4326:
SRID = 27572 # Lambert zone II - France
SURFACE_SRID = 2154 # Lambert 93 - France