annotate gpp/settings/base.py @ 510:e6298cde9cc9

After creating a virtualenv (finally), adding a requirements file.
author Brian Neal <bgneal@gmail.com>
date Thu, 08 Dec 2011 02:25:22 +0000
parents 1a09a7bea000
children 3fd369e1197f
rev   line source
bgneal@499 1 # Base Django settings for the gpp project.
bgneal@499 2
bgneal@499 3 import os
bgneal@499 4 from decimal import Decimal
bgneal@499 5
bgneal@499 6 import django.utils.simplejson as json
bgneal@499 7 from django.contrib.messages import constants as message_constants
bgneal@499 8
bgneal@499 9 PROJECT_PATH = os.path.abspath(os.path.join(os.path.split(__file__)[0], '..'))
bgneal@499 10
bgneal@499 11 DEBUG = True
bgneal@499 12 TEMPLATE_DEBUG = DEBUG
bgneal@499 13
bgneal@499 14 ADMINS = (
bgneal@499 15 ('Brian Neal', 'admin@surfguitar101.com'),
bgneal@499 16 )
bgneal@499 17
bgneal@499 18 MANAGERS = ADMINS
bgneal@499 19
bgneal@499 20 AUTH_PROFILE_MODULE = 'bio.userprofile'
bgneal@499 21
bgneal@499 22 INTERNAL_IPS = ['127.0.0.1']
bgneal@499 23
bgneal@499 24 # Local time zone for this installation. Choices can be found here:
bgneal@499 25 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
bgneal@499 26 # although not all choices may be available on all operating systems.
bgneal@499 27 # If running in a Windows environment this must be set to the same as your
bgneal@499 28 # system time zone.
bgneal@499 29 TIME_ZONE = 'America/Chicago'
bgneal@499 30
bgneal@499 31 # Language code for this installation. All choices can be found here:
bgneal@499 32 # http://www.i18nguy.com/unicode/language-identifiers.html
bgneal@499 33 LANGUAGE_CODE = 'en-us'
bgneal@499 34
bgneal@499 35 SITE_ID = 1
bgneal@499 36
bgneal@499 37 # If you set this to False, Django will make some optimizations so as not
bgneal@499 38 # to load the internationalization machinery.
bgneal@499 39 USE_I18N = False
bgneal@499 40
bgneal@499 41 # Absolute path to the directory that holds media.
bgneal@499 42 # Example: "/home/media/media.lawrence.com/"
bgneal@499 43 MEDIA_ROOT = os.path.abspath(os.path.join(PROJECT_PATH, '..', 'media'))
bgneal@499 44
bgneal@499 45 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
bgneal@499 46 # trailing slash if there is a path component (optional in other cases).
bgneal@499 47 # Examples: "http://media.lawrence.com", "http://example.com/media/"
bgneal@499 48 MEDIA_URL = '/media/'
bgneal@499 49
bgneal@499 50 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
bgneal@499 51 # trailing slash.
bgneal@499 52 # Examples: "http://foo.com/media/", "/media/".
bgneal@499 53 ADMIN_MEDIA_PREFIX = '/static/admin/'
bgneal@499 54
bgneal@499 55 # Staticfiles settings:
bgneal@499 56 STATICFILES_DIRS = [
bgneal@499 57 os.path.abspath(os.path.join(PROJECT_PATH, '..', 'static')),
bgneal@499 58 ]
bgneal@499 59 STATIC_ROOT = '/tmp/test_static_root'
bgneal@499 60 STATIC_URL = '/static/'
bgneal@499 61
bgneal@499 62 # Make this unique, and don't share it with anybody.
bgneal@499 63 SECRETS = json.load(open(os.path.join(PROJECT_PATH, 'settings', 'secrets.json')))
bgneal@499 64 SECRET_KEY = SECRETS['SECRET_KEY']
bgneal@499 65
bgneal@499 66 # List of Loader classes that know how to import templates from various sources.
bgneal@499 67
bgneal@499 68 TEMPLATE_LOADERS = (
bgneal@499 69 'django.template.loaders.filesystem.Loader',
bgneal@499 70 'django.template.loaders.app_directories.Loader',
bgneal@499 71 )
bgneal@499 72
bgneal@499 73 MIDDLEWARE_CLASSES = [
bgneal@499 74 'django.middleware.common.CommonMiddleware',
bgneal@499 75 'django.middleware.csrf.CsrfViewMiddleware',
bgneal@499 76 'django.contrib.sessions.middleware.SessionMiddleware',
bgneal@499 77 'django.contrib.messages.middleware.MessageMiddleware',
bgneal@499 78 'django.contrib.auth.middleware.AuthenticationMiddleware',
bgneal@499 79 'gpp.core.middleware.InactiveUserMiddleware',
bgneal@499 80 'gpp.core.middleware.WhosOnline',
bgneal@499 81 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
bgneal@499 82 ]
bgneal@499 83
bgneal@499 84 ROOT_URLCONF = 'gpp.urls'
bgneal@499 85
bgneal@499 86 TEMPLATE_DIRS = (
bgneal@499 87 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
bgneal@499 88 # Always use forward slashes, even on Windows.
bgneal@499 89 # Don't forget to use absolute paths, not relative paths.
bgneal@499 90 os.path.join(PROJECT_PATH, 'templates'),
bgneal@499 91 )
bgneal@499 92
bgneal@499 93 TEMPLATE_CONTEXT_PROCESSORS = (
bgneal@499 94 "django.contrib.auth.context_processors.auth",
bgneal@499 95 "django.core.context_processors.debug",
bgneal@499 96 "django.core.context_processors.request",
bgneal@499 97 "django.core.context_processors.media",
bgneal@499 98 "django.core.context_processors.static",
bgneal@499 99 "django.contrib.messages.context_processors.messages",
bgneal@499 100 )
bgneal@499 101
bgneal@499 102 INSTALLED_APPS = [
bgneal@499 103 'django.contrib.admin',
bgneal@499 104 'django.contrib.admindocs',
bgneal@499 105 'django.contrib.auth',
bgneal@499 106 'django.contrib.contenttypes',
bgneal@499 107 'django.contrib.flatpages',
bgneal@499 108 'django.contrib.humanize',
bgneal@499 109 'django.contrib.markup',
bgneal@499 110 'django.contrib.messages',
bgneal@499 111 'django.contrib.sessions',
bgneal@499 112 'django.contrib.sites',
bgneal@499 113 'django.contrib.staticfiles',
bgneal@499 114 'elsewhere',
bgneal@499 115 'tagging',
bgneal@499 116 'haystack',
bgneal@499 117 'queued_search',
bgneal@499 118 'accounts',
bgneal@499 119 'antispam',
bgneal@499 120 'bio',
bgneal@499 121 'bulletins',
bgneal@499 122 'comments',
bgneal@499 123 'contact',
bgneal@499 124 'core',
bgneal@499 125 'donations',
bgneal@499 126 'downloads',
bgneal@499 127 'forums',
bgneal@499 128 'gcalendar',
bgneal@499 129 'irc',
bgneal@499 130 'legacy',
bgneal@499 131 'mailer',
bgneal@499 132 'membermap',
bgneal@499 133 'messages',
bgneal@499 134 'news',
bgneal@499 135 'oembed',
bgneal@499 136 'podcast',
bgneal@499 137 'polls',
bgneal@499 138 'potd',
bgneal@499 139 'shoutbox',
bgneal@499 140 'smiley',
bgneal@499 141 'weblinks',
bgneal@499 142 'ygroup',
bgneal@499 143 ]
bgneal@499 144
bgneal@499 145 LOGIN_URL = '/accounts/login/'
bgneal@499 146 LOGIN_REDIRECT_URL = '/profile/me/'
bgneal@499 147 LOGOUT_URL = '/accounts/logout/'
bgneal@499 148
bgneal@499 149 FILE_UPLOAD_PERMISSIONS = 0644
bgneal@499 150 DEFAULT_FROM_EMAIL = ADMINS[0][1]
bgneal@499 151
bgneal@499 152 #######################################################################
bgneal@499 153 # Messages
bgneal@499 154 #######################################################################
bgneal@499 155 MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'
bgneal@499 156 MESSAGE_TAGS = {
bgneal@499 157 message_constants.DEBUG: 'notice',
bgneal@499 158 message_constants.INFO: 'info',
bgneal@499 159 message_constants.SUCCESS: 'success',
bgneal@499 160 message_constants.WARNING: 'alert',
bgneal@499 161 message_constants.ERROR: 'error',
bgneal@499 162 }
bgneal@499 163
bgneal@499 164 #######################################################################
bgneal@499 165 # Email
bgneal@499 166 #######################################################################
bgneal@499 167 EMAIL_HOST = 'localhost'
bgneal@499 168 EMAIL_PORT = 1025
bgneal@499 169
bgneal@499 170 #######################################################################
bgneal@499 171 # Sessions
bgneal@499 172 #######################################################################
bgneal@499 173 SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"
bgneal@499 174 SESSION_COOKIE_AGE = 2 * 7 * 24 * 60 * 60 # 2 weeks in seconds
bgneal@499 175 SESSION_COOKIE_DOMAIN = None
bgneal@499 176 SESSION_COOKIE_NAME = 'sg101_sessionid'
bgneal@499 177 SESSION_COOKIE_PATH = '/'
bgneal@499 178 SESSION_COOKIE_SECURE = False
bgneal@499 179 SESSION_EXPIRE_AT_BROWSER_CLOSE = False
bgneal@499 180 SESSION_SAVE_EVERY_REQUEST = False
bgneal@499 181
bgneal@499 182 #######################################################################
bgneal@499 183 # Tagging Specific Settings
bgneal@499 184 #######################################################################
bgneal@499 185 FORCE_LOWERCASE_TAGS = True
bgneal@499 186 MAX_TAG_LENGTH = 50
bgneal@499 187
bgneal@499 188 #######################################################################
bgneal@499 189 # Haystack Search Settings
bgneal@499 190 #######################################################################
bgneal@499 191 HAYSTACK_SITECONF = 'gpp.search_sites'
bgneal@499 192 HAYSTACK_SEARCH_ENGINE = 'xapian'
bgneal@499 193 HAYSTACK_XAPIAN_PATH = os.path.join(PROJECT_PATH, 'xapian_index')
bgneal@499 194
bgneal@499 195
bgneal@499 196 #######################################################################
bgneal@499 197 # GPP Specific Settings
bgneal@499 198 #######################################################################
bgneal@499 199 GPP_LOG_LEVEL = 0
bgneal@499 200 GPP_SEND_EMAIL = False
bgneal@499 201 GPP_NO_REPLY_EMAIL = 'no_reply'
bgneal@499 202 AVATAR_DIR = 'avatars'
bgneal@499 203 MAX_AVATAR_SIZE_BYTES = 2 * 1024 * 1024
bgneal@499 204 MAX_AVATAR_SIZE_PIXELS = 100
bgneal@499 205 AVATAR_DEFAULT_URL = MEDIA_URL + AVATAR_DIR + '/default.png'
bgneal@499 206
bgneal@499 207 # Donations application settings:
bgneal@499 208 DONATIONS_DEBUG = False
bgneal@499 209 DONATIONS_ITEM_NAME = 'Donation for SurfGuitar101.com'
bgneal@499 210 DONATIONS_BUSINESS = 'brian@surfguitar101.com'
bgneal@499 211 DONATIONS_BUSINESS_DEBUG = 'bgneal_1246137628_biz@gmail.com'
bgneal@499 212 DONATIONS_GOAL = Decimal('100.00') # monthly goal
bgneal@499 213 DONATIONS_ANON_NAME = u'Anonymous'
bgneal@499 214 DONATIONS_ITEM_NUM = '500' # donation w/name listed
bgneal@499 215 DONATIONS_ITEM_ANON_NUM = '501' # donation listed as anonymous
bgneal@499 216
bgneal@499 217 # If MAILER_ENQUEUE_MAIL is True, all emails will be stored in the
bgneal@499 218 # mailer application's mail queue (database table). It is then expected
bgneal@499 219 # that a daemon or cron job will actually send the mail out. If
bgneal@499 220 # MAILER_ENQUEUE_MAIL is False, then email will only be sent if
bgneal@499 221 # the setting GPP_SEND_EMAIL (above) is True. In any event, emails
bgneal@499 222 # will be logged via the Python logger if the Python logger filter
bgneal@499 223 # DEBUG is active.
bgneal@499 224
bgneal@499 225 MAILER_ENQUEUE_MAIL = True
bgneal@499 226
bgneal@499 227 # Oembed settings
bgneal@499 228 OEMBED_MAXWIDTH = 480
bgneal@499 229 OEMBED_MAXHEIGHT = 295
bgneal@499 230
bgneal@499 231 # GCalendar settings
bgneal@499 232 GCAL_CALENDAR_ID = 'i81lu3fkh57sgqqenogefd9v78@group.calendar.google.com'
bgneal@499 233
bgneal@499 234 # Google OAuth settings
bgneal@499 235 GOOGLE_OAUTH_CONSUMER_KEY = 'surfguitar101.com'
bgneal@499 236 GOOGLE_OAUTH_PRIVATE_KEY_PATH = '/home/brian/google/myrsakey.pem'
bgneal@499 237
bgneal@499 238 #######################################################################
bgneal@499 239 # Asynchronous settings (queues, queued_search, redis, celery, etc)
bgneal@499 240 #######################################################################
bgneal@499 241 QUEUE_BACKEND = 'redisd'
bgneal@499 242 QUEUE_REDIS_CONNECTION = 'localhost:6379'
bgneal@499 243 QUEUE_REDIS_DB = 0
bgneal@499 244
bgneal@499 245 #######################################################################
bgneal@499 246 # Open Graph Protocol related settings
bgneal@499 247 #######################################################################
bgneal@499 248 OGP_DEFAULT_IMAGE = 'http://surfguitar101.com/media/podcast/podcast_logo.jpg'
bgneal@499 249 OGP_FB_ID = '100001558124013'
bgneal@499 250
bgneal@499 251 #######################################################################
bgneal@499 252 # URL's of 3rd party Javascript and CSS files.
bgneal@499 253 # These dictionaries are used by core/templatetags/script_tags, and
bgneal@499 254 # should also be used by developers when creating form media classes.
bgneal@499 255 GPP_THIRD_PARTY_JS = {
bgneal@499 256 'jquery': [
bgneal@499 257 'http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js',
bgneal@499 258 ],
bgneal@499 259 'jquery-jeditable': [
bgneal@499 260 'js/jquery.jeditable.mini.js',
bgneal@499 261 ],
bgneal@499 262 'jquery-ui': [
bgneal@499 263 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js',
bgneal@499 264 ],
bgneal@499 265 'markitup': [
bgneal@499 266 'js/markitup/jquery.markitup.pack.js',
bgneal@499 267 'js/markitup/sets/markdown/set.js',
bgneal@499 268 ],
bgneal@499 269 'tiny_mce': [
bgneal@499 270 'js/tiny_mce/tiny_mce.js',
bgneal@499 271 'js/tiny_mce_init_std.js',
bgneal@499 272 ],
bgneal@499 273 }
bgneal@499 274
bgneal@499 275 GPP_THIRD_PARTY_CSS = {
bgneal@499 276 'jquery-ui': [
bgneal@499 277 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/themes/redmond/jquery-ui.css',
bgneal@499 278 ],
bgneal@499 279 'markitup': [
bgneal@499 280 'js/markitup/skins/markitup/style.css',
bgneal@499 281 'js/markitup/sets/markdown/style.css',
bgneal@499 282 ],
bgneal@499 283 }
bgneal@499 284