summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2015-10-25 10:38:53 +0100
committerÉtienne Loks <etienne.loks@proxience.com>2015-10-25 10:38:53 +0100
commit2018f169a8eccdd4f08bdd9cc27edc2e238d1eb6 (patch)
tree451aeccf75f3cfcd84f05df973ea08c7a45e0a32
parentc50678be0bd848295425e7ec0361b9b190c0ad00 (diff)
downloadIshtar-2018f169a8eccdd4f08bdd9cc27edc2e238d1eb6.tar.bz2
Ishtar-2018f169a8eccdd4f08bdd9cc27edc2e238d1eb6.zip
Fix default log file path for multiple instances
-rw-r--r--example_project/local_settings.py.sample18
-rw-r--r--example_project/settings.py7
2 files changed, 15 insertions, 10 deletions
diff --git a/example_project/local_settings.py.sample b/example_project/local_settings.py.sample
index f8f0f3e75..dae6f98b5 100644
--- a/example_project/local_settings.py.sample
+++ b/example_project/local_settings.py.sample
@@ -34,21 +34,21 @@ DEBUG_TOOLBAR = False
TEMPLATE_DEBUG = DEBUG
SQL_DEBUG = False
+PROJECT_SLUG = "my-project"
+
# complete with host/domain names that this website can serve
ALLOWED_HOSTS = []
# if your installation uses a prefix after the domain name modify and uncomment
# theses lines
-#DOMAIN_PREFIX = "/ishtar-test"
-#LOGIN_URL = DOMAIN_PREFIX + '/accounts/login/'
-#LOGIN_REDIRECT_URL = DOMAIN_PREFIX + '/accounts/profile/'
-#LOGOUT_URL = DOMAIN_PREFIX + '/accounts/logout/'
-
-
+# DOMAIN_PREFIX = "/ishtar-test"
+# LOGIN_URL = DOMAIN_PREFIX + '/accounts/login/'
+# LOGIN_REDIRECT_URL = DOMAIN_PREFIX + '/accounts/profile/'
+# LOGOUT_URL = DOMAIN_PREFIX + '/accounts/logout/'
# Ishtar custom
SRID = 27572
-ENCODING = '' # specific encoding for CSV export - default to utf-8
+ENCODING = '' # specific encoding for CSV export - default to utf-8
SURFACE_UNIT = 'square-metre'
SURFACE_UNIT_LABEL = u'm²'
@@ -57,6 +57,6 @@ SURFACE_UNIT_LABEL = u'm²'
EXTRA_APPS = [
'archaeological_files',
'archaeological_context_records',
- 'archaeological_warehouse', # need archaeological_finds
- 'archaeological_finds', # need archaeological_context_records
+ 'archaeological_warehouse', # need archaeological_finds
+ 'archaeological_finds', # need archaeological_context_records
]
diff --git a/example_project/settings.py b/example_project/settings.py
index f4d7ca609..43917523b 100644
--- a/example_project/settings.py
+++ b/example_project/settings.py
@@ -128,7 +128,7 @@ INSTALLED_APPS = [
# 'debug_toolbar',
]
-LOGFILE = '/var/log/django/ishtar.log'
+LOGFILE = ''
LOGGING = {
'version': 1,
@@ -218,8 +218,13 @@ if 'archaeological_files' in EXTRA_APPS:
INSTALLED_APPS += EXTRA_APPS
+PROJECT_SLUG = locals().get('PROJECT_SLUG', 'default')
+
if LOGFILE:
LOGGING['handlers']['logfile']['filename'] = LOGFILE
+else:
+ LOGGING['handlers']['logfile']['filename'] = \
+ '/var/log/django/ishtar-' + PROJECT_SLUG + '.log'
INTERNAL_IPS = ('127.0.0.1',)