annotate mysite/settings.py @ 27:c185fcf5817f

Fix links to press article pdf files.
author Brian Neal <bgneal@gmail.com>
date Wed, 30 Mar 2011 01:19:40 +0000
parents efb2da0b5d10
children
rev   line source
bgneal@1 1 # Django settings for madeira project.
bgneal@1 2
bgneal@1 3 import os
bgneal@1 4 import platform
bgneal@1 5 import local_settings
bgneal@1 6 project_path = os.path.abspath(os.path.split(__file__)[0])
bgneal@1 7
bgneal@1 8 DEBUG = local_settings.DEBUG
bgneal@1 9 TEMPLATE_DEBUG = DEBUG
bgneal@1 10
bgneal@1 11 ADMINS = (
bgneal@1 12 ('Brian Neal', 'admin@surfguitar101.com'),
bgneal@1 13 )
bgneal@1 14
bgneal@1 15 MANAGERS = ADMINS
bgneal@1 16
bgneal@26 17 DATABASES = local_settings.DATABASES
bgneal@1 18
bgneal@1 19 INTERNAL_IPS = local_settings.INTERNAL_IPS
bgneal@1 20
bgneal@1 21 # Local time zone for this installation. Choices can be found here:
bgneal@1 22 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
bgneal@1 23 # although not all choices may be available on all operating systems.
bgneal@1 24 # If running in a Windows environment this must be set to the same as your
bgneal@1 25 # system time zone.
bgneal@1 26 TIME_ZONE = local_settings.TIME_ZONE
bgneal@1 27
bgneal@1 28 # Language code for this installation. All choices can be found here:
bgneal@1 29 # http://www.i18nguy.com/unicode/language-identifiers.html
bgneal@1 30 LANGUAGE_CODE = 'en-us'
bgneal@1 31
bgneal@1 32 SITE_ID = local_settings.SITE_ID
bgneal@1 33
bgneal@1 34 # If you set this to False, Django will make some optimizations so as not
bgneal@1 35 # to load the internationalization machinery.
bgneal@1 36 USE_I18N = False
bgneal@1 37
bgneal@1 38 # Absolute path to the directory that holds media.
bgneal@1 39 # Example: "/home/media/media.lawrence.com/"
bgneal@1 40 MEDIA_ROOT = local_settings.MEDIA_ROOT
bgneal@1 41
bgneal@1 42 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
bgneal@1 43 # trailing slash if there is a path component (optional in other cases).
bgneal@1 44 # Examples: "http://media.lawrence.com", "http://example.com/media/"
bgneal@1 45 MEDIA_URL = local_settings.MEDIA_URL
bgneal@1 46
bgneal@1 47 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
bgneal@1 48 # trailing slash.
bgneal@1 49 # Examples: "http://foo.com/media/", "/media/".
bgneal@1 50 ADMIN_MEDIA_PREFIX = local_settings.ADMIN_MEDIA_PREFIX
bgneal@1 51
bgneal@26 52 # Staticfiles settings:
bgneal@26 53 STATICFILES_DIRS = local_settings.STATICFILES_DIRS
bgneal@26 54 STATIC_ROOT = local_settings.STATIC_ROOT
bgneal@26 55 STATIC_URL = local_settings.STATIC_URL
bgneal@26 56
bgneal@1 57 # Make this unique, and don't share it with anybody.
bgneal@1 58 SECRET_KEY = local_settings.SECRET_KEY
bgneal@1 59
bgneal@26 60 if DEBUG:
bgneal@26 61 TEMPLATE_LOADERS = (
bgneal@26 62 'django.template.loaders.filesystem.Loader',
bgneal@26 63 'django.template.loaders.app_directories.Loader',
bgneal@26 64 )
bgneal@26 65 else:
bgneal@26 66 TEMPLATE_LOADERS = (
bgneal@26 67 ('django.template.loaders.cached.Loader', (
bgneal@26 68 'django.template.loaders.filesystem.Loader',
bgneal@26 69 'django.template.loaders.app_directories.Loader',
bgneal@26 70 )),
bgneal@26 71 )
bgneal@1 72
bgneal@26 73 if DEBUG:
bgneal@26 74 MIDDLEWARE_CLASSES = (
bgneal@26 75 'django.middleware.common.CommonMiddleware',
bgneal@26 76 'django.middleware.csrf.CsrfViewMiddleware',
bgneal@26 77 'django.contrib.sessions.middleware.SessionMiddleware',
bgneal@26 78 'django.contrib.messages.middleware.MessageMiddleware',
bgneal@26 79 'debug_toolbar.middleware.DebugToolbarMiddleware',
bgneal@26 80 'django.contrib.auth.middleware.AuthenticationMiddleware',
bgneal@26 81 'django.middleware.doc.XViewMiddleware',
bgneal@26 82 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
bgneal@26 83 )
bgneal@26 84 else:
bgneal@26 85 MIDDLEWARE_CLASSES = (
bgneal@26 86 'django.middleware.common.CommonMiddleware',
bgneal@26 87 'django.middleware.csrf.CsrfViewMiddleware',
bgneal@26 88 'django.contrib.sessions.middleware.SessionMiddleware',
bgneal@26 89 'django.contrib.messages.middleware.MessageMiddleware',
bgneal@26 90 'django.contrib.auth.middleware.AuthenticationMiddleware',
bgneal@26 91 'django.middleware.doc.XViewMiddleware',
bgneal@26 92 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
bgneal@26 93 )
bgneal@1 94
bgneal@26 95 #######################################################################
bgneal@26 96 # Caching
bgneal@26 97 #######################################################################
bgneal@26 98 if local_settings.USE_CACHE:
bgneal@26 99 CACHES = local_settings.CACHES
bgneal@26 100 CACHE_MIDDLEWARE_ANONYMOUS_ONLY = local_settings.CACHE_MIDDLEWARE_ANONYMOUS_ONLY
bgneal@26 101 CACHE_MIDDLEWARE_SECONDS = local_settings.CACHE_MIDDLEWARE_SECONDS
bgneal@26 102 CACHE_MIDDLEWARE_KEY_PREFIX = local_settings.CACHE_MIDDLEWARE_KEY_PREFIX
bgneal@1 103
bgneal@1 104 ROOT_URLCONF = 'mysite.urls'
bgneal@1 105
bgneal@1 106 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
bgneal@1 107 # Always use forward slashes, even on Windows.
bgneal@1 108 # Don't forget to use absolute paths, not relative paths.
bgneal@1 109 TEMPLATE_DIRS = (
bgneal@1 110 os.path.join(project_path, 'templates'),
bgneal@1 111 os.path.join(project_path, 'templates', 'band'),
bgneal@1 112 os.path.join(project_path, 'photologue', 'templates'),
bgneal@1 113 )
bgneal@1 114
bgneal@1 115 TEMPLATE_CONTEXT_PROCESSORS = (
bgneal@26 116 "django.contrib.auth.context_processors.auth",
bgneal@26 117 "django.core.context_processors.debug",
bgneal@26 118 "django.core.context_processors.request",
bgneal@26 119 "django.core.context_processors.media",
bgneal@26 120 "django.core.context_processors.static",
bgneal@26 121 "django.contrib.messages.context_processors.messages",
bgneal@1 122 )
bgneal@1 123
bgneal@26 124 INSTALLED_APPS = [
bgneal@26 125 'django.contrib.admin',
bgneal@26 126 'django.contrib.admindocs',
bgneal@1 127 'django.contrib.auth',
bgneal@1 128 'django.contrib.contenttypes',
bgneal@26 129 'django.contrib.flatpages',
bgneal@26 130 'django.contrib.markup',
bgneal@26 131 'django.contrib.messages',
bgneal@1 132 'django.contrib.sessions',
bgneal@1 133 'django.contrib.sites',
bgneal@26 134 'django.contrib.staticfiles',
bgneal@1 135 'mysite.band',
bgneal@1 136 'mysite.photologue',
bgneal@26 137 ]
bgneal@26 138 if DEBUG:
bgneal@26 139 INSTALLED_APPS.append('debug_toolbar')
bgneal@26 140
bgneal@26 141 #######################################################################
bgneal@26 142 # Messages
bgneal@26 143 #######################################################################
bgneal@26 144 MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'
bgneal@26 145
bgneal@26 146 #######################################################################
bgneal@26 147 # Email
bgneal@26 148 #######################################################################
bgneal@26 149 EMAIL_HOST = local_settings.EMAIL_HOST
bgneal@26 150 EMAIL_PORT = local_settings.EMAIL_PORT
bgneal@26 151
bgneal@26 152 #######################################################################
bgneal@26 153 # Sessions
bgneal@26 154 #######################################################################
bgneal@26 155 SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"
bgneal@26 156 SESSION_COOKIE_AGE = 2 * 7 * 24 * 60 * 60 # 2 weeks in seconds
bgneal@26 157 SESSION_COOKIE_DOMAIN = None
bgneal@26 158 SESSION_COOKIE_NAME = 'madeira_sessionid'
bgneal@26 159 SESSION_COOKIE_PATH = '/'
bgneal@26 160 SESSION_COOKIE_SECURE = False
bgneal@26 161 SESSION_EXPIRE_AT_BROWSER_CLOSE = False
bgneal@26 162 SESSION_SAVE_EVERY_REQUEST = False
bgneal@26 163
bgneal@26 164 #######################################################################
bgneal@26 165 # Configure Logging
bgneal@26 166 #######################################################################
bgneal@26 167
bgneal@26 168 LOGGING = local_settings.LOGGING
bgneal@26 169
bgneal@26 170 #######################################################################
bgneal@26 171 # Django Debug Toolbar
bgneal@26 172 #######################################################################
bgneal@26 173
bgneal@26 174 if DEBUG:
bgneal@26 175 DEBUG_TOOLBAR_CONFIG = local_settings.DEBUG_TOOLBAR_CONFIG
bgneal@26 176