From 57056d9a27f5b76ef1385a528e5dd2ea8361ba3b Mon Sep 17 00:00:00 2001 From: Stefan Koegl Date: Sat, 3 Jul 2010 14:41:35 +0200 Subject: [PATCH] sanitizing settings and updating for Django 1.2 --- .gitignore | 1 + mygpo/settings.py | 58 +++++++++++++++++++++++++++---------------------------- 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/.gitignore b/.gitignore index 27185145..baefc03e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ htdocs/media/logo/* logs/* *.mo +mygpo/settings_prod.py diff --git a/mygpo/settings.py b/mygpo/settings.py index 761eda9c..a050f6c8 100644 --- a/mygpo/settings.py +++ b/mygpo/settings.py @@ -18,25 +18,27 @@ import os.path +BASE_DIR = os.path.dirname(os.path.abspath(__file__)) + # http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#ChangedthewayURLpathsaredetermined FORCE_SCRIPT_NAME="" DEBUG = True TEMPLATE_DEBUG = DEBUG -ADMINS = ( - ('stefan', 'stefan@skoegl.net'), - # ('Your Name', 'your_email@domain.com'), -) +ADMINS = () MANAGERS = ADMINS -DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. -DATABASE_NAME = 'mygpo' # Or path to database file if using sqlite3. -DATABASE_USER = 'mygpo' # 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': { + 'NAME': 'mygpo', + 'ENGINE': 'django.db.backends.sqlite3', + 'USER': '', + 'PASSWORD': '', + 'HOST': '', + } +} # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name @@ -69,14 +71,9 @@ MEDIA_URL = '' # Examples: "http://foo.com/media/", "/media/". ADMIN_MEDIA_PREFIX = '/media/admin/' -# Make this unique, and don't share it with anybody. -SECRET_KEY = '8s(g1_%+-^@xw*ulzg&gmhj+mp5!m50-p5!721aoai3q67kym!' - # 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.eggs.load_template_source', + 'django.template.loaders.app_directories.Loader', ) MIDDLEWARE_CLASSES = ( @@ -89,11 +86,7 @@ MIDDLEWARE_CLASSES = ( ROOT_URLCONF = 'mygpo.urls' -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. -) +TEMPLATE_DIRS = () INSTALLED_APPS = ( 'django.contrib.auth', @@ -103,7 +96,6 @@ INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.humanize', 'registration', - 'haystack', 'mygpo.api', 'mygpo.web', 'mygpo.publisher', @@ -128,16 +120,24 @@ TEMPLATE_CONTEXT_PROCESSORS = ( ) -DEFAULT_FROM_EMAIL = 'mygpo@my.gpodder.org' - AUTH_PROFILE_MODULE = "api.UserProfile" LOGIN_URL = '/login/' -#see http://haystacksearch.org/docs/ -HAYSTACK_SITECONF = 'mygpo.search_sites' -HAYSTACK_SEARCH_ENGINE = 'whoosh' -HAYSTACK_WHOOSH_PATH = os.path.abspath('%s/../search_index' % os.path.dirname(__file__)) - CSRF_FAILURE_VIEW='mygpo.security.csrf_failure' + +# The following entries should be set in settings_prod.py +DEFAULT_FROM_EMAIL = '' +SECRET_KEY = '' +GOOGLE_ANALYTICS_PROPERTY_ID='' +DIRECTORY_EXCLUDED_TAGS = () +FLICKR_API_KEY = '' + + +try: + from settings_prod import * +except ImportError, e: + import sys + print >> sys.stderr, 'create settings_prod.py with your customized settings' + -- 2.11.4.GIT