view madeira/settings/base.py @ 205:b4566292bbfe tip

Update t-shirt inventory
author Brian Neal <bgneal@gmail.com>
date Sun, 06 Nov 2022 17:42:25 -0600
parents 312f198e8958
children
line wrap: on
line source
# Base Django settings for madeira project.

import os
import json

PROJECT_PATH = os.path.abspath(os.path.join(os.path.split(__file__)[0], '..'))

DEBUG = True

ADMINS = [
    ('Brian Neal', 'admin@surfguitar101.com'),
]

MANAGERS = ADMINS

INTERNAL_IPS = ['127.0.0.1']

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'America/Chicago'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = False

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = os.path.abspath(os.path.join(PROJECT_PATH, '..', 'media'))

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = '/media/'

# Staticfiles settings:
STATICFILES_DIRS = [
    os.path.abspath(os.path.join(PROJECT_PATH, '..', 'static')),
]
STATIC_ROOT = '/tmp/test_madeira_static_root'
STATIC_URL = '/static/'

# Make this unique, and don't share it with anybody.
SECRETS = json.load(open(os.path.join(PROJECT_PATH, 'settings', 'secrets.json')))
SECRET_KEY = SECRETS['SECRET_KEY']

MIDDLEWARE_CLASSES = [
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.admindocs.middleware.XViewMiddleware',
    'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
]

ROOT_URLCONF = 'madeira.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [
            os.path.join(PROJECT_PATH, 'templates'),
            os.path.abspath(os.path.join(PROJECT_PATH, '..', 'photologue', 'templates')),
        ],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                "django.contrib.auth.context_processors.auth",
                "django.template.context_processors.debug",
                "django.template.context_processors.request",
                "django.template.context_processors.media",
                "django.template.context_processors.static",
                "django.contrib.messages.context_processors.messages",
            ],
        },
    },
]

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.admindocs',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.flatpages',
    'django.contrib.messages',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.staticfiles',
    'localflavor',
    'articles',
    'band',
    'core',
    'email_list',
    'gigs',
    'mp3',
    'news',
    'videos',
    'photologue',
]

# Turn off warning about test runner behavior change
SILENCED_SYSTEM_CHECKS = ['1_6.W001']

#######################################################################
# Messages
#######################################################################
MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'

#######################################################################
# Email
#######################################################################
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
EMAIL_HOST = 'localhost'
EMAIL_PORT = 1025

#######################################################################
# Sessions
#######################################################################
SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"
SESSION_COOKIE_AGE = 2 * 7 * 24 * 60 * 60   # 2 weeks in seconds
SESSION_COOKIE_DOMAIN = None
SESSION_COOKIE_NAME = 'madeira_sessionid'
SESSION_COOKIE_PATH = '/'
SESSION_COOKIE_SECURE = False
SESSION_EXPIRE_AT_BROWSER_CLOSE = False
SESSION_SAVE_EVERY_REQUEST = False

#######################################################################
# 3rd party Javascript and CSS files.
#
# Listed here to for DRY purposes.
#
THIRD_PARTY_JS = {
    'tiny_mce': [
        'js/tinymce/jscripts/tiny_mce/tiny_mce.js',
        'js/tiny_mce_init.js',
    ],
}

THIRD_PARTY_CSS = {
}

#######################################################################
# Basic Madeira band settings
#######################################################################
BAND_CONFIG = {
    'BAND_NAME': 'The Madeira',
    'BAND_DOMAIN': 'themadeira.net',
    'BAND_EMAIL': 'themadeira@themadeira.net',
}