]> git.ozlabs.org Git - patchwork/blobdiff - apps/settings.py
Resolve removed 'AUTH_PROFILE_MODULE' setting
[patchwork] / apps / settings.py
index df656dec951abc631c0ec3f1740f13d811fb4fca..379fbc5128771a43e6a5ac17adf477604ce9c977 100644 (file)
@@ -1,4 +1,5 @@
 # Django settings for patchwork project.
+import os
 
 DEBUG = True
 TEMPLATE_DEBUG = DEBUG
@@ -9,12 +10,12 @@ ADMINS = (
 
 MANAGERS = ADMINS
 
-DATABASE_ENGINE = 'postgresql'           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
-DATABASE_NAME = 'patchwork'             # Or path to database file if using sqlite3.
-DATABASE_USER = ''             # Not used with sqlite3.
-DATABASE_PASSWORD = ''         # Not used with sqlite3.
-DATABASE_HOST = ''             # Set to empty string for localhost. Not used with sqlite3.
-DATABASE_PORT = ''             # Set to empty string for default. Not used with sqlite3.
+DATABASES = {
+    'default': {
+        'ENGINE': 'django.db.backends.postgresql_psycopg2',
+        'NAME': 'patchwork',
+    },
+}
 
 # Local time zone for this installation. Choices can be found here:
 # http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
@@ -34,10 +35,6 @@ SITE_ID = 1
 # to load the internationalization machinery.
 USE_I18N = True
 
-# Absolute path to the directory that holds media.
-# Example: "/home/media/media.lawrence.com/"
-MEDIA_ROOT = '/srv/patchwork/lib/python/django/contrib/admin/media'
-
 # URL that handles the media served from MEDIA_ROOT.
 # Example: "http://media.lawrence.com"
 MEDIA_URL = ''
@@ -52,8 +49,8 @@ SECRET_KEY = '00000000000000000000000000000000000000000000000000'
 
 # List of callables that know how to import templates from various sources.
 TEMPLATE_LOADERS = (
-    'django.template.loaders.filesystem.load_template_source',
-    'django.template.loaders.app_directories.load_template_source',
+    'django.template.loaders.filesystem.Loader',
+    'django.template.loaders.app_directories.Loader',
 #     'django.template.loaders.eggs.load_template_source',
 )
 
@@ -61,27 +58,34 @@ MIDDLEWARE_CLASSES = (
     'django.middleware.common.CommonMiddleware',
     'django.contrib.sessions.middleware.SessionMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
+    'django.contrib.messages.middleware.MessageMiddleware',
     'django.middleware.doc.XViewMiddleware',
+    'django.middleware.csrf.CsrfViewMiddleware',
 )
 
-ROOT_URLCONF = 'apps.urls'
+ROOT_URLCONF = 'urls'
 
-LOGIN_URL = '/patchwork/login'
+LOGIN_URL = '/user/login/'
+LOGIN_REDIRECT_URL = '/user/'
 
+ROOT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir)
 TEMPLATE_DIRS = (
     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
     # Always use forward slashes, even on Windows.
     # Don't forget to use absolute paths, not relative paths.
-    '/srv/patchwork/templates'
+    os.path.join(ROOT_DIR, 'templates'),
 )
+# Absolute path to the directory that holds media.
+# Example: "/home/media/media.lawrence.com/"
+MEDIA_ROOT = os.path.join(
+    ROOT_DIR, 'lib', 'python', 'django', 'contrib', 'admin', 'media')
+
 TEMPLATE_CONTEXT_PROCESSORS = (
-    "django.core.context_processors.auth",
+    "django.contrib.auth.context_processors.auth",
     "django.core.context_processors.debug",
     "django.core.context_processors.i18n",
     "django.core.context_processors.media")
 
-AUTH_PROFILE_MODULE = "patchwork.userprofile"
-
 INSTALLED_APPS = (
     'django.contrib.auth',
     'django.contrib.contenttypes',
@@ -92,4 +96,31 @@ INSTALLED_APPS = (
 )
 
 DEFAULT_PATCHES_PER_PAGE = 100
-PATCHWORK_FROM_EMAIL = 'Patchwork <patchwork@patchwork.example.com>'
+DEFAULT_FROM_EMAIL = 'Patchwork <patchwork@patchwork.example.com>'
+
+CONFIRMATION_VALIDITY_DAYS = 7
+
+NOTIFICATION_DELAY_MINUTES = 10
+NOTIFICATION_FROM_EMAIL = DEFAULT_FROM_EMAIL
+
+# Set to True to enable the Patchwork XML-RPC interface
+ENABLE_XMLRPC = False
+
+# set to True to enable redirections or URLs from previous versions
+# of patchwork
+COMPAT_REDIR = True
+
+# Set to True to always generate https:// links instead of guessing
+# the scheme based on current access. This is useful if SSL protocol
+# is terminated upstream of the server (e.g. at the load balancer)
+FORCE_HTTPS_LINKS = False
+
+try:
+    from local_settings import *
+except ImportError, ex:
+    import sys
+    sys.stderr.write(\
+            ("settings.py: error importing local settings file:\n" + \
+            "\t%s\n" + \
+            "Do you have a local_settings.py module?\n") % str(ex))
+    raise