diff options
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 |
commit | f1a1cc8c8ccd489b8d8830002fa58fdf0ef28275 (patch) | |
tree | 451aeccf75f3cfcd84f05df973ea08c7a45e0a32 | |
parent | fd90c3bfc1b06a807f5e3e9e3cddec1689ac378e (diff) | |
download | Ishtar-f1a1cc8c8ccd489b8d8830002fa58fdf0ef28275.tar.bz2 Ishtar-f1a1cc8c8ccd489b8d8830002fa58fdf0ef28275.zip |
Fix default log file path for multiple instances
-rw-r--r-- | example_project/local_settings.py.sample | 18 | ||||
-rw-r--r-- | example_project/settings.py | 7 |
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',) |