bgneal@1: # Django settings for madeira project. bgneal@1: bgneal@1: import os bgneal@1: import platform bgneal@1: import local_settings bgneal@1: project_path = os.path.abspath(os.path.split(__file__)[0]) bgneal@1: bgneal@1: DEBUG = local_settings.DEBUG bgneal@1: TEMPLATE_DEBUG = DEBUG bgneal@1: bgneal@1: ADMINS = ( bgneal@1: ('Brian Neal', 'admin@surfguitar101.com'), bgneal@1: ) bgneal@1: bgneal@1: MANAGERS = ADMINS bgneal@1: bgneal@26: DATABASES = local_settings.DATABASES bgneal@1: bgneal@1: INTERNAL_IPS = local_settings.INTERNAL_IPS bgneal@1: bgneal@1: # Local time zone for this installation. Choices can be found here: bgneal@1: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name bgneal@1: # although not all choices may be available on all operating systems. bgneal@1: # If running in a Windows environment this must be set to the same as your bgneal@1: # system time zone. bgneal@1: TIME_ZONE = local_settings.TIME_ZONE bgneal@1: bgneal@1: # Language code for this installation. All choices can be found here: bgneal@1: # http://www.i18nguy.com/unicode/language-identifiers.html bgneal@1: LANGUAGE_CODE = 'en-us' bgneal@1: bgneal@1: SITE_ID = local_settings.SITE_ID bgneal@1: bgneal@1: # If you set this to False, Django will make some optimizations so as not bgneal@1: # to load the internationalization machinery. bgneal@1: USE_I18N = False bgneal@1: bgneal@1: # Absolute path to the directory that holds media. bgneal@1: # Example: "/home/media/media.lawrence.com/" bgneal@1: MEDIA_ROOT = local_settings.MEDIA_ROOT bgneal@1: bgneal@1: # URL that handles the media served from MEDIA_ROOT. Make sure to use a bgneal@1: # trailing slash if there is a path component (optional in other cases). bgneal@1: # Examples: "http://media.lawrence.com", "http://example.com/media/" bgneal@1: MEDIA_URL = local_settings.MEDIA_URL bgneal@1: bgneal@1: # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a bgneal@1: # trailing slash. bgneal@1: # Examples: "http://foo.com/media/", "/media/". bgneal@1: ADMIN_MEDIA_PREFIX = local_settings.ADMIN_MEDIA_PREFIX bgneal@1: bgneal@26: # Staticfiles settings: bgneal@26: STATICFILES_DIRS = local_settings.STATICFILES_DIRS bgneal@26: STATIC_ROOT = local_settings.STATIC_ROOT bgneal@26: STATIC_URL = local_settings.STATIC_URL bgneal@26: bgneal@1: # Make this unique, and don't share it with anybody. bgneal@1: SECRET_KEY = local_settings.SECRET_KEY bgneal@1: bgneal@26: if DEBUG: bgneal@26: TEMPLATE_LOADERS = ( bgneal@26: 'django.template.loaders.filesystem.Loader', bgneal@26: 'django.template.loaders.app_directories.Loader', bgneal@26: ) bgneal@26: else: bgneal@26: TEMPLATE_LOADERS = ( bgneal@26: ('django.template.loaders.cached.Loader', ( bgneal@26: 'django.template.loaders.filesystem.Loader', bgneal@26: 'django.template.loaders.app_directories.Loader', bgneal@26: )), bgneal@26: ) bgneal@1: bgneal@26: if DEBUG: bgneal@26: MIDDLEWARE_CLASSES = ( bgneal@26: 'django.middleware.common.CommonMiddleware', bgneal@26: 'django.middleware.csrf.CsrfViewMiddleware', bgneal@26: 'django.contrib.sessions.middleware.SessionMiddleware', bgneal@26: 'django.contrib.messages.middleware.MessageMiddleware', bgneal@26: 'debug_toolbar.middleware.DebugToolbarMiddleware', bgneal@26: 'django.contrib.auth.middleware.AuthenticationMiddleware', bgneal@26: 'django.middleware.doc.XViewMiddleware', bgneal@26: 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', bgneal@26: ) bgneal@26: else: bgneal@26: MIDDLEWARE_CLASSES = ( bgneal@26: 'django.middleware.common.CommonMiddleware', bgneal@26: 'django.middleware.csrf.CsrfViewMiddleware', bgneal@26: 'django.contrib.sessions.middleware.SessionMiddleware', bgneal@26: 'django.contrib.messages.middleware.MessageMiddleware', bgneal@26: 'django.contrib.auth.middleware.AuthenticationMiddleware', bgneal@26: 'django.middleware.doc.XViewMiddleware', bgneal@26: 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', bgneal@26: ) bgneal@1: bgneal@26: ####################################################################### bgneal@26: # Caching bgneal@26: ####################################################################### bgneal@26: if local_settings.USE_CACHE: bgneal@26: CACHES = local_settings.CACHES bgneal@26: CACHE_MIDDLEWARE_ANONYMOUS_ONLY = local_settings.CACHE_MIDDLEWARE_ANONYMOUS_ONLY bgneal@26: CACHE_MIDDLEWARE_SECONDS = local_settings.CACHE_MIDDLEWARE_SECONDS bgneal@26: CACHE_MIDDLEWARE_KEY_PREFIX = local_settings.CACHE_MIDDLEWARE_KEY_PREFIX bgneal@1: bgneal@1: ROOT_URLCONF = 'mysite.urls' bgneal@1: bgneal@1: # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". bgneal@1: # Always use forward slashes, even on Windows. bgneal@1: # Don't forget to use absolute paths, not relative paths. bgneal@1: TEMPLATE_DIRS = ( bgneal@1: os.path.join(project_path, 'templates'), bgneal@1: os.path.join(project_path, 'templates', 'band'), bgneal@1: os.path.join(project_path, 'photologue', 'templates'), bgneal@1: ) bgneal@1: bgneal@1: TEMPLATE_CONTEXT_PROCESSORS = ( bgneal@26: "django.contrib.auth.context_processors.auth", bgneal@26: "django.core.context_processors.debug", bgneal@26: "django.core.context_processors.request", bgneal@26: "django.core.context_processors.media", bgneal@26: "django.core.context_processors.static", bgneal@26: "django.contrib.messages.context_processors.messages", bgneal@1: ) bgneal@1: bgneal@26: INSTALLED_APPS = [ bgneal@26: 'django.contrib.admin', bgneal@26: 'django.contrib.admindocs', bgneal@1: 'django.contrib.auth', bgneal@1: 'django.contrib.contenttypes', bgneal@26: 'django.contrib.flatpages', bgneal@26: 'django.contrib.markup', bgneal@26: 'django.contrib.messages', bgneal@1: 'django.contrib.sessions', bgneal@1: 'django.contrib.sites', bgneal@26: 'django.contrib.staticfiles', bgneal@1: 'mysite.band', bgneal@1: 'mysite.photologue', bgneal@26: ] bgneal@26: if DEBUG: bgneal@26: INSTALLED_APPS.append('debug_toolbar') bgneal@26: bgneal@26: ####################################################################### bgneal@26: # Messages bgneal@26: ####################################################################### bgneal@26: MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage' bgneal@26: bgneal@26: ####################################################################### bgneal@26: # Email bgneal@26: ####################################################################### bgneal@26: EMAIL_HOST = local_settings.EMAIL_HOST bgneal@26: EMAIL_PORT = local_settings.EMAIL_PORT bgneal@26: bgneal@26: ####################################################################### bgneal@26: # Sessions bgneal@26: ####################################################################### bgneal@26: SESSION_ENGINE = "django.contrib.sessions.backends.cached_db" bgneal@26: SESSION_COOKIE_AGE = 2 * 7 * 24 * 60 * 60 # 2 weeks in seconds bgneal@26: SESSION_COOKIE_DOMAIN = None bgneal@26: SESSION_COOKIE_NAME = 'madeira_sessionid' bgneal@26: SESSION_COOKIE_PATH = '/' bgneal@26: SESSION_COOKIE_SECURE = False bgneal@26: SESSION_EXPIRE_AT_BROWSER_CLOSE = False bgneal@26: SESSION_SAVE_EVERY_REQUEST = False bgneal@26: bgneal@26: ####################################################################### bgneal@26: # Configure Logging bgneal@26: ####################################################################### bgneal@26: bgneal@26: LOGGING = local_settings.LOGGING bgneal@26: bgneal@26: ####################################################################### bgneal@26: # Django Debug Toolbar bgneal@26: ####################################################################### bgneal@26: bgneal@26: if DEBUG: bgneal@26: DEBUG_TOOLBAR_CONFIG = local_settings.DEBUG_TOOLBAR_CONFIG bgneal@26: