Source

django-in-a-box / project / etc.templates / common.py

# -*- coding: utf-8 -*-

import django
from paver.path import path


## Project

PROJECT_DIR = path(__file__).abspath().dirname().parent
PROJECT_NAME = PROJECT_DIR.basename()
SITE_DIR = PROJECT_DIR.parent

ADMINS = (
    ('Your Name', 'username@example.com'),
)

MANAGERS = ADMINS

TIME_ZONE = 'Europe/London'
LANGUAGE_CODE = 'en-gb'

SITE_ID = 1
USE_I18N = True

SECRET_KEY = '{{ generate_secret_key() }}'

## Media

MEDIA_ROOT = PROJECT_DIR / 'media' / ''
MEDIA_URL = '/media/'
ADMIN_MEDIA_PREFIX = '/media/admin/'
ADMIN_MEDIA_ROOT = path(django.__file__).abspath().dirname() / 'contrib' / 'admin' / 'media'

## Templates

TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.load_template_source',
    'django.template.loaders.app_directories.load_template_source',
)

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.core.context_processors.auth',
    'django.core.context_processors.debug',
    'django.core.context_processors.i18n',
    'django.core.context_processors.media'
)

TEMPLATE_DIRS = (
    PROJECT_DIR / 'templates',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'djanjinja.middleware.RequestContextMiddleware',
)

## URLs

ROOT_URLCONF = PROJECT_NAME + '.urls'
FORCE_SCRIPT_NAME = '' # Fixes a common issue with lighttpd + FastCGI.

## Installed applications


INSTALLED_APPS = (
    ## Django contrib apps
    # 'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    
    ## Third-party apps
    'djanjinja',
    
    ## Local apps
    # Nothing here yet.
)