diff --git a/humbug/settings.py b/humbug/settings.py index b04267c777..74474c9771 100644 --- a/humbug/settings.py +++ b/humbug/settings.py @@ -333,8 +333,12 @@ CACHES['database'] = { if DEPLOYED: SERVER_LOG_PATH = "/home/humbug/logs/server.log" + EVENT_LOG_DIR = '/home/humbug/logs/event_log' + STATS_DIR = '/home/humbug/stats' else: + EVENT_LOG_DIR = 'event_log' SERVER_LOG_PATH = "server.log" + STATS_DIR = 'stats' LOGGING = { 'version': 1, @@ -437,8 +441,6 @@ OPENID_RENDER_FAILURE = openid_failure_handler MAILCHIMP_API_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-us4' HUMBUG_FRIENDS_LIST_ID = '84b2f3da6b' -EVENT_LOG_DIR = 'event_log' - # Client-side polling timeout for get_events, in milliseconds. # We configure this here so that the client test suite can override it. # We already kill the connection server-side with heartbeat events, diff --git a/zephyr/lib/stats.py b/zephyr/lib/stats.py index 2e27a658b8..6c48fd1e03 100644 --- a/zephyr/lib/stats.py +++ b/zephyr/lib/stats.py @@ -1,15 +1,14 @@ +from django.conf import settings import os import logging -STATS_DIR = os.path.join(os.path.dirname(__file__), "..", "..", "stats") - def update_stat(name, value): try: - os.mkdir(STATS_DIR) + os.mkdir(settings.STATS_DIR) except OSError: pass - base_filename = os.path.join(STATS_DIR, name) + base_filename = os.path.join(settings.STATS_DIR, name) tmp_filename = base_filename + ".new" try: