]> git.openstreetmap.org Git - osqa.git/blobdiff - settings_local.py.dist
Merge pull request #46 from udacity/subfolder_fixes
[osqa.git] / settings_local.py.dist
index aab362a696d4513022fb40a9eb9d5dcdab1265b8..e687228a3084c98c9c8ced11f603ad2e9589be6b 100644 (file)
@@ -1,27 +1,38 @@
 # encoding:utf-8
 import os.path
-from django.utils.translation import ugettext as _
-
-def check_local_setting(name, value):
-    local_vars = locals()
-    if name in local_vars and local_vars[name] == value:
-        return True
-    else:
-        return False
 
 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 = (('Forum Admin', 'forum@example.com'),)
+ADMINS = ()
 MANAGERS = ADMINS
 
 DEBUG = False
@@ -30,49 +41,42 @@ DEBUG_TOOLBAR_CONFIG = {
 }
 TEMPLATE_DEBUG = DEBUG
 INTERNAL_IPS = ('127.0.0.1',)
-
-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 = ''
+ALLOWED_HOSTS = ('yourhostname.com',)
+
+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://'
 SESSION_ENGINE = 'django.contrib.sessions.backends.db'
+# Customize the values below if OSQA is in a subfolder and especially you're planning on
+# running multiple Django applications (OSQA or others) on the same domain in different
+# subfolders
+#SESSION_COOKIE_PATH = '/'
+#CSRF_COOKIE_PATH = '/'
 
-APP_URL = 'http://' #used by email notif system and RSS
+# This should be equal to your domain name, plus the web application context.
+# This shouldn't be followed by a trailing slash.
+# I.e., http://www.yoursite.com or http://www.hostedsite.com/yourhostapp
+APP_URL = 'http://'
 
 #LOCALIZATIONS
 TIME_ZONE = 'America/New_York'
 
-###########################
-#
-#   this will allow running your forum with url like http://site.com/forum
-#
-#   FORUM_SCRIPT_ALIAS = 'forum/'
-#
-FORUM_SCRIPT_ALIAS = '' #no leading slash, default = '' empty string
-
-
 #OTHER SETTINGS
 
 USE_I18N = True
 LANGUAGE_CODE = 'en'
-EMAIL_VALIDATION = 'off' #string - on|off
-MIN_USERNAME_LENGTH = 1
-EMAIL_UNIQUE = False
-
-WIKI_ON = True
-FEEDBACK_SITE_URL = None #None or url
-EDITABLE_SCREEN_NAME = False #True or False - can user change screen name?
-
-DJANGO_VERSION = 1.1
-RESOURCE_REVISION=4
 
 OSQA_DEFAULT_SKIN = 'default'
 
 DISABLED_MODULES = ['books', 'recaptcha', 'project_badges']
-
-from forum.settings import *
\ No newline at end of file