X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/5c47f3f671ab9708a1f4391a40f17c53c6c7a78b..9417d3254858438fe5fa59160bfd9edef1332c90:/settings_local.py.dist diff --git a/settings_local.py.dist b/settings_local.py.dist index afcc539..896a433 100644 --- a/settings_local.py.dist +++ b/settings_local.py.dist @@ -3,14 +3,33 @@ import os.path SITE_SRC_ROOT = os.path.dirname(__file__) LOG_FILENAME = 'django.osqa.log' - -#for logging -import logging -logging.basicConfig( - filename=os.path.join(SITE_SRC_ROOT, 'log', LOG_FILENAME), - level=logging.ERROR, - format='%(pathname)s TIME: %(asctime)s MSG: %(filename)s:%(funcName)s:%(lineno)d %(message)s', -) +LOGGING = { + 'version': 1, + 'formatters': { + 'default': { + 'format': '%(pathname)s TIME: %(asctime)s MSG: %(filename)s:%(funcName)s:%(lineno)d %(message)s', + } + }, + 'handlers': { + 'file': { + 'level': 'DEBUG', + 'class': 'logging.FileHandler', + 'formatter': 'default', + 'filename': os.path.join(SITE_SRC_ROOT, 'log', LOG_FILENAME), + }, + }, + 'loggers' : { + # ensure that all log entries are propagated to root + 'django': { 'propagate': True }, + 'django.request': { 'propagate': True }, + 'django.security': { 'propagate': True }, + 'py.warnings': { 'propagate': True }, + }, + 'root': { + 'handlers': ['file'], + 'level': 'DEBUG', + }, +} #ADMINS and MANAGERS ADMINS = () @@ -22,14 +41,19 @@ DEBUG_TOOLBAR_CONFIG = { } TEMPLATE_DEBUG = DEBUG INTERNAL_IPS = ('127.0.0.1',) +ALLOWED_HOSTS = ('yourhostname.com',) - -DATABASE_NAME = '' # Or path to database file if using sqlite3. -DATABASE_USER = '' # Not used with sqlite3. -DATABASE_PASSWORD = '' # Not used with sqlite3. -DATABASE_ENGINE = '' #mysql, etc -DATABASE_HOST = '' -DATABASE_PORT = '' +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.mysql', + 'NAME': 'osqa', + 'USER': 'root', + 'PASSWORD': '', + 'HOST': '', + 'PORT': '', + 'CONN_MAX_AGE': 600, + } +} CACHE_BACKEND = 'file://%s' % os.path.join(os.path.dirname(__file__),'cache').replace('\\','/') #CACHE_BACKEND = 'dummy://' @@ -51,4 +75,4 @@ LANGUAGE_CODE = 'en' DJANGO_VERSION = 1.1 OSQA_DEFAULT_SKIN = 'default' -DISABLED_MODULES = ['books', 'recaptcha', 'project_badges', 'updater'] +DISABLED_MODULES = ['books', 'recaptcha', 'project_badges']