|
| 1 | +# vim: ai ts=4 sts=4 et sw=4 |
| 2 | +import os |
| 3 | +import socket |
| 4 | +from sys import argv |
| 5 | + |
| 6 | +# Django settings for scribblitt project. |
| 7 | + |
| 8 | +# Set DEBUG = True if on the production server |
| 9 | +LOCAL_SERVER_ARGS = ('runserver', 'runserver_plus', 'runprofileserver', ) |
| 10 | +if len(set(argv) & set(LOCAL_SERVER_ARGS)) > 0: |
| 11 | + DEBUG = True |
| 12 | +else: |
| 13 | + DEBUG = False |
| 14 | + |
| 15 | +TEMPLATE_DEBUG = DEBUG |
| 16 | + |
| 17 | +ADMINS = ( |
| 18 | + ( 'Damon Jablons', '[email protected]'), |
| 19 | +) |
| 20 | + |
| 21 | +MANAGERS = ADMINS |
| 22 | + |
| 23 | +DATABASES = { |
| 24 | + 'default': { |
| 25 | + 'ENGINE': 'django.db.backends.sqlite3', |
| 26 | + 'NAME': '' |
| 27 | + } |
| 28 | +} |
| 29 | + |
| 30 | +# Local time zone for this installation. Choices can be found here: |
| 31 | +# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name |
| 32 | +# although not all choices may be available on all operating systems. |
| 33 | +# If running in a Windows environment this must be set to the same as your |
| 34 | +# system time zone. |
| 35 | +TIME_ZONE = 'America/New_York' |
| 36 | + |
| 37 | +# Language code for this installation. All choices can be found here: |
| 38 | +# http://www.i18nguy.com/unicode/language-identifiers.html |
| 39 | +LANGUAGE_CODE = 'en-us' |
| 40 | + |
| 41 | +SITE_ID = 1 |
| 42 | + |
| 43 | +# If you set this to False, Django will make some optimizations so as not |
| 44 | +# to load the internationalization machinery. |
| 45 | +USE_I18N = False |
| 46 | + |
| 47 | +# This dynamically discovers the path to the project |
| 48 | +PROJECT_PATH = os.path.realpath(os.path.dirname(__file__)) |
| 49 | + |
| 50 | +# Absolute path to the directory that holds media. |
| 51 | +# Example: "/home/media/media.lawrence.com/" |
| 52 | +MEDIA_ROOT = os.path.join(PROJECT_PATH, 'media') |
| 53 | + |
| 54 | +# URL that handles the media served from MEDIA_ROOT. Make sure to use a |
| 55 | +# trailing slash if there is a path component (optional in other cases). |
| 56 | +# Examples: "http://media.lawrence.com", "http://example.com/media/" |
| 57 | +MEDIA_URL = '/media/' |
| 58 | + |
| 59 | +# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a |
| 60 | +# trailing slash. |
| 61 | +# Examples: "http://foo.com/media/", "/media/". |
| 62 | +ADMIN_MEDIA_PREFIX = '%sadmin-media/' % MEDIA_URL |
| 63 | + |
| 64 | +# Make this unique, and don't share it with anybody. |
| 65 | +SECRET_KEY = '' |
| 66 | + |
| 67 | +# List of callables that know how to import templates from various sources. |
| 68 | +TEMPLATE_LOADERS = ( |
| 69 | + 'django.template.loaders.filesystem.load_template_source', |
| 70 | + 'django.template.loaders.app_directories.load_template_source', |
| 71 | +) |
| 72 | + |
| 73 | +# Context Processors |
| 74 | +TEMPLATE_CONTEXT_PROCESSORS = ( |
| 75 | + 'django.core.context_processors.auth', |
| 76 | + 'django.core.context_processors.media', |
| 77 | + 'django.core.context_processors.request', |
| 78 | +) |
| 79 | + |
| 80 | +if DEBUG: |
| 81 | + TEMPLATE_CONTEXT_PROCESSORS += ('django.core.context_processors.debug',) |
| 82 | +if USE_I18N: |
| 83 | + TEMPLATE_CONTEXT_PROCESSORS += ('django.core.context_processors.i18n',) |
| 84 | + |
| 85 | +MIDDLEWARE_CLASSES = ( |
| 86 | + 'django.middleware.common.CommonMiddleware', |
| 87 | + 'django.contrib.sessions.middleware.SessionMiddleware', |
| 88 | + 'django.contrib.auth.middleware.AuthenticationMiddleware', |
| 89 | +) |
| 90 | + |
| 91 | +if DEBUG: |
| 92 | + MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',) |
| 93 | + |
| 94 | +ROOT_URLCONF = 'urls' |
| 95 | + |
| 96 | +TEMPLATE_DIRS = () |
| 97 | +for root, dirs, files in os.walk(PROJECT_PATH): |
| 98 | + if 'templates' in dirs: TEMPLATE_DIRS += (os.path.join(root, 'templates'),) |
| 99 | + |
| 100 | +INSTALLED_APPS = ( |
| 101 | + # Django Applications |
| 102 | + 'django.contrib.auth', |
| 103 | + 'django.contrib.contenttypes', |
| 104 | + 'django.contrib.sessions', |
| 105 | + 'django.contrib.sites', |
| 106 | + 'django.contrib.admin', |
| 107 | + 'django.contrib.admindocs', |
| 108 | + |
| 109 | + # Third Party Django Applications |
| 110 | + 'django_extensions', |
| 111 | + 'sorl.thumbnail', |
| 112 | + |
| 113 | + # Project Applications |
| 114 | +) |
| 115 | + |
| 116 | +if DEBUG: |
| 117 | + INSTALLED_APPS += ('debug_toolbar',) |
| 118 | + |
| 119 | +TEMPLATE_TAGS = ( |
| 120 | + 'sorl.thumbnail.templatetags.thumbnail', |
| 121 | +) |
| 122 | + |
| 123 | +# SORL Settings |
| 124 | +THUMBNAIL_EXTENSION = 'jpg' |
| 125 | + |
| 126 | +INTERNAL_IPS = ( |
| 127 | + '127.0.0.1', |
| 128 | +) |
| 129 | + |
| 130 | +DEBUG_TOOLBAR_CONFIG = { |
| 131 | + 'INTERCEPT_REDIRECTS': False, |
| 132 | +} |
| 133 | + |
| 134 | +try: |
| 135 | + from local_settings import * |
| 136 | +except ImportError: |
| 137 | + pass |
0 commit comments