Commits

Luke Plant committed 1d4565b

Added public settings files

These had been filtered out in repository conversion in order to not expose
passwords etc. if this repository is made public.

  • Participants
  • Parent commits 9771c60

Comments (0)

Files changed (5)

+syntax:glob
+*~
+*.pyc
+*\.\#*
+*\#
+settings*priv.py

File cciw/settings.py

+# Settings file for live environment
+import os
+from cciw.settings_common import *
+from cciw.settings_priv import DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, DATABASE_HOST
+
+DEBUG = False
+TEMPLATE_DEBUG = False
+
+basedir = os.path.dirname(os.path.abspath(os.path.dirname(__file__))) # ../
+
+# Absolute path to the directory that holds media.
+MEDIA_ROOT = basedir + '/media'
+
+# URL that handles the media served from MEDIA_ROOT.
+MEDIA_URL = 'http://www.cciw.co.uk/media'
+SPECIAL_MEDIA_URL = 'http://www.cciw.co.uk/sp_media'
+
+MIDDLEWARE_CLASSES = (
+    "django.middleware.http.SetRemoteAddrFromForwardedFor",
+    "django.middleware.common.CommonMiddleware",
+#    "django.middleware.cache.CacheMiddleware",
+    "django.middleware.gzip.GZipMiddleware",
+#    "lukeplant_me_uk.django.middleware.validator.ValidatorMiddleware",
+    "django.contrib.csrf.middleware.CsrfMiddleware",
+    "django.contrib.sessions.middleware.SessionMiddleware",
+    "django.contrib.auth.middleware.AuthenticationMiddleware",
+    "cciw.middleware.threadlocals.ThreadLocals",
+)
+
+
+TEMPLATE_DIRS = (
+    basedir + r'/templates',
+)
+
+FILE_UPLOAD_TEMP_DIR = basedir + "/uploads"
+
+ADMIN_MEDIA_PREFIX = '/admin_media/'
+
+CCIW_MEDIA_URL = MEDIA_URL
+
+ESV_KEY = 'IP'
+
+SEND_BROKEN_LINK_EMAILS = False

File cciw/settings_calvin.py

+# Settings file for development box (calvin)
+import os
+from cciw.settings_common import *
+
+DEBUG = True
+TEMPLATE_DEBUG = True
+
+DATABASE_NAME = 'cciw'
+DATABASE_USER = 'cciw'
+DATABASE_PASSWORD = 'foo'
+DATABASE_HOST = ''        # Set to empty string for localhost. Not used with sqlite3.
+DATABASE_PORT = 5433
+
+basedir = os.path.dirname(os.path.abspath(os.path.dirname(__file__))) # ../
+# Django source is in:
+# ../django_src  or ../django_src_live
+django_src = os.path.dirname(basedir) + os.path.basename(basedir).replace("current", "django")
+
+# Absolute path to the directory that holds media.
+
+MEDIA_ROOT =  basedir + '/media'
+
+# URL that handles the media served from MEDIA_ROOT.
+# Example: "http://media.lawrence.com"
+MEDIA_URL = 'http://cciw_local/media'
+SPECIAL_MEDIA_URL = 'http://cciw_local/sp_media'
+#MEDIA_URL = 'http://localhost:8000/media/'
+
+MIDDLEWARE_CLASSES = (
+    "django.middleware.doc.XViewMiddleware",
+    "django.middleware.common.CommonMiddleware",
+#    "django.middleware.cache.CacheMiddleware",
+#    "django.middleware.gzip.GZipMiddleware", # interferes with testing
+    "lukeplant_me_uk.django.validator.middleware.ValidatorMiddleware",
+#    "django.contrib.csrf.middleware.CsrfMiddleware", # interferes with testing
+    "django.contrib.sessions.middleware.SessionMiddleware",
+    "django.contrib.auth.middleware.AuthenticationMiddleware",
+    "cciw.middleware.threadlocals.ThreadLocals",
+)
+
+INSTALLED_APPS = INSTALLED_APPS + (
+    'lukeplant_me_uk.django.validator',
+)
+
+TEMPLATE_DIRS = (
+    basedir + r'/templates',
+)
+
+FILE_UPLOAD_TEMP_DIR = basedir + "/uploads"
+
+FIXTURE_DIRS = [
+    basedir + r'/cciw/cciwmain/fixtures'
+]
+TEST_DIR = basedir + r'/cciw/cciwmain/tests'
+
+ADMIN_MEDIA_PREFIX = '/admin_media/' # this requires trailing slash
+
+CCIW_MEDIA_URL = MEDIA_URL
+
+SEND_BROKEN_LINK_EMAILS = True
+
+# For e-mail testing, run:
+#  fakemail.py --path=/home/luke/httpd/www.cciw.co.uk/tests/mail --background
+EMAIL_HOST = 'localhost'
+EMAIL_HOST_USER = None
+EMAIL_HOST_PASSWORD = None
+EMAIL_PORT = 8025
+
+ESV_KEY = 'IP'

File cciw/settings_common.py

+# Django settings for cciw project.
+
+from cciw.settings_common_priv import SECRET_KEY, EMAIL_HOST_USER, EMAIL_HOST_PASSWORD, CSRF_MIDDLEWARE_SECRET
+from cciw.settings_common_priv import MAILBOX_PASSWORD, WEBFACTION_PASSWORD, WEBFACTION_USER, IMAP_MAIL_SERVER
+
+INTERNAL_IPS = ('127.0.0.1',)
+
+ADMINS = (
+    ('Luke Plant', 'L.Plant.98@cantab.net'),
+)
+
+MANAGERS = ADMINS
+
+LANGUAGE_CODE = 'en-gb'
+
+DATABASE_ENGINE = 'postgresql_psycopg2'
+
+SITE_ID = 1
+
+SEND_BROKEN_LINK_EMAILS=True
+
+CACHE_MIDDLEWARE_SECONDS = 200
+
+ROOT_URLCONF = 'cciw.urls'
+
+VALIDATOR_APP_VALIDATORS = {
+    'text/html': '/home/luke/httpd/myvalidate.sh',
+    'application/xml+xhtml': '/home/luke/httpd/myvalidate.sh',
+}
+
+VALIDATOR_APP_IGNORE_PATHS = (
+    '/admin/',
+)
+
+INSTALLED_APPS = (
+    'django.contrib.auth',
+    'django.contrib.admin',
+    'django.contrib.contenttypes',
+    'django.contrib.sessions',
+    'django.contrib.sites',
+    'cciw.cciwmain',
+    'cciw.officers',
+    'cciw.tagging',
+    'cciw.utils',
+)
+
+TIME_ZONE = "Europe/London"
+TEMPLATE_LOADERS = (
+    'django.template.loaders.filesystem.load_template_source',
+    'django.template.loaders.app_directories.load_template_source',
+)
+
+TEMPLATE_CONTEXT_PROCESSORS = (
+    "django.core.context_processors.auth",
+    "django.core.context_processors.debug",
+    "django.core.context_processors.i18n",
+    "cciw.cciwmain.common.standard_processor",
+)
+
+SERVER_EMAIL = "website@cciw.co.uk"
+DEFAULT_FROM_EMAIL = SERVER_EMAIL
+EMAIL_HOST = "mail1.webfaction.com"
+
+USE_I18N = False
+
+LOGIN_URL = "/officers/"
+
+FILE_UPLOAD_MAX_MEMORY_SIZE = 262144
+
+## CCIW SPECIFIC SETTINGS AND CONSTANTS
+AWARD_UPLOAD_PATH = 'images/awards'
+MEMBER_ICON_UPLOAD_PATH = 'images/members/temp'
+MEMBER_ICON_PATH = 'images/members'
+DEFAULT_MEMBER_ICON = 'defaultmember.gif'
+MEMBER_ICON_MAX_SIZE = 48
+
+CAMP_FORUM_RE = r'camps/(?P<year>\d{4})/(?P<number>\d+|all)/forum/'
+
+FORUM_PAGINATE_POSTS_BY = 20
+FORUM_PAGINATE_PHOTOS_BY = 20
+FORUM_PAGINATE_TOPICS_BY = 30
+ESV_BROWSE_URL = "http://www.gnpcb.org/esv/search/"
+FEEDBACK_EMAIL_TO = "L.Plant.98@cantab.net"
+BOOKINGFORMDIR = "downloads"
+MEMBERS_PAGINATE_MESSAGES_BY = 20
+WEBMASTER_EMAIL = FEEDBACK_EMAIL_TO
+LIST_MAILBOX_NAME = "camplists"
+LIST_MAIL_DEBUG_ADDRESSES = [
+]

File cciw/settings_tests.py

+# Settings file for testing on development box
+
+from cciw.settings_calvin import *
+
+DEBUG = False
+TEMPLATE_DEBUG = False
+DEBUG_PROPAGATE_EXCEPTIONS = True
+
+DATABASE_ENGINE = 'sqlite3'
+DATABASE_NAME = ':memory:'
+
+MIDDLEWARE_CLASSES = (
+    "django.middleware.common.CommonMiddleware",
+#    "django.middleware.cache.CacheMiddleware",
+#    "django.middleware.gzip.GZipMiddleware",
+#    "lukeplant_me_uk.django.validator.middleware.ValidatorMiddleware",
+#    "django.contrib.csrf.middleware.CsrfMiddleware",
+    "django.contrib.sessions.middleware.SessionMiddleware",
+    "django.contrib.auth.middleware.AuthenticationMiddleware",
+    "cciw.middleware.threadlocals.ThreadLocals",
+)
+
+INSTALLED_APPS = filter(lambda x: x != "lukeplant_me_uk.django.validator", INSTALLED_APPS)
+
+SEND_BROKEN_LINK_EMAILS = False
+