X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=apps%2Fsettings.py;h=7523099374cc09922008bc3cb3ddc3f81b101842;hb=59ddd051801cf70c7841686ec2b45af523d0050e;hp=8b33182de5c09ea9ead42a247d70bc179ff946f9;hpb=f1e089f7736ac8f7b9af784461350c4c169211ad;p=patchwork diff --git a/apps/settings.py b/apps/settings.py index 8b33182..7523099 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,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 = '' @@ -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,10 +96,25 @@ INSTALLED_APPS = ( 'django.contrib.sites', 'django.contrib.admin', 'patchwork', - 'registration', ) DEFAULT_PATCHES_PER_PAGE = 100 -PATCHWORK_FROM_EMAIL = 'Patchwork ' +DEFAULT_FROM_EMAIL = 'Patchwork ' + +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 -ACCOUNT_ACTIVATION_DAYS = 7 +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