X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=apps%2Fsettings.py;h=8f091d0c672bdb4e24f2959121e4fa71f0409b38;hb=41f19b6643b44768dc06561c992c04ed6148477d;hp=f70ac2a5a14e0a09fd9ac7fa217a90d61c39e65d;hpb=83964878e92ce0687d47409b5832e7220e57d79f;p=patchwork diff --git a/apps/settings.py b/apps/settings.py index f70ac2a..8f091d0 100644 --- a/apps/settings.py +++ b/apps/settings.py @@ -1,4 +1,5 @@ # Django settings for patchwork project. +import os DEBUG = True TEMPLATE_DEBUG = DEBUG @@ -9,7 +10,7 @@ ADMINS = ( MANAGERS = ADMINS -DATABASE_ENGINE = 'postgresql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'. +DATABASE_ENGINE = 'postgresql_psycopg2' # '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. @@ -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 = '' @@ -62,19 +59,28 @@ MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.doc.XViewMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', ) ROOT_URLCONF = 'apps.urls' -LOGIN_URL = '/accounts/login' +LOGIN_URL = '/user/login/' LOGIN_REDIRECT_URL = '/user/' +# If you change the ROOT_DIR setting in your local_settings.py, you'll need to +# re-define the variables that use this (MEDIA_ROOT and TEMPLATE_DIRS) too. +ROOT_DIR = '/srv/patchwork' 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.core.context_processors.debug", @@ -90,36 +96,18 @@ INSTALLED_APPS = ( 'django.contrib.sites', 'django.contrib.admin', 'patchwork', - 'registration', ) DEFAULT_PATCHES_PER_PAGE = 100 DEFAULT_FROM_EMAIL = 'Patchwork ' -ACCOUNT_ACTIVATION_DAYS = 7 +CONFIRMATION_VALIDITY_DAYS = 7 # Set to True to enable the Patchwork XML-RPC interface ENABLE_XMLRPC = False -XMLRPC_METHODS = ( - # List methods to be exposed in the form (, ,) - ('patchwork.xmlrpc.pw_rpc_version', 'pw_rpc_version',), - ('patchwork.xmlrpc.patch_list', 'patch_list',), - ('patchwork.xmlrpc.patch_get', 'patch_get',), - ('patchwork.xmlrpc.patch_get_mbox', 'patch_get_mbox',), - ('patchwork.xmlrpc.patch_get_diff', 'patch_get_diff',), - ('patchwork.xmlrpc.project_list', 'project_list',), - ('patchwork.xmlrpc.project_get', 'project_get',), - ('patchwork.xmlrpc.person_list', 'person_list',), - ('patchwork.xmlrpc.person_get', 'person_get',), - ('patchwork.xmlrpc.state_list', 'state_list',), - ('patchwork.xmlrpc.state_get', 'state_get',), -) - try: from local_settings import * - if ENABLE_XMLRPC: - INSTALLED_APPS = INSTALLED_APPS + ('django_xmlrpc',) except ImportError, ex: import sys sys.stderr.write(\