1eec8323fef01ce263e3d5710598fd5b5efbe49f
[eatslugs.git] / eatslugs / settings.py
1 # Django settings for eatslugs project.
2
3 # Rather than editing settings here, add them to the localsettings.py file
4 # which will be included at the end of the run and replace anything in here.
5
6 import os
7 topdir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
8
9 DEBUG = True
10 TEMPLATE_DEBUG = DEBUG
11
12 ADMINS = (
13     ('Brett Parker', 'iDunno@sommitrealweird.co.uk'),
14 )
15
16 MANAGERS = ADMINS
17
18 DATABASES = {
19     'default': {
20             'ENGINE': 'django.db.backends.sqlite3',
21             'NAME': os.path.join(topdir, 'eatslugs.db')
22     }
23 }
24
25 TIME_ZONE = 'Europe/London'
26
27 LANGUAGE_CODE = 'en-gb'
28
29 SITE_ID = 1
30
31 # If you set this to False, Django will make some optimizations so as not
32 # to load the internationalization machinery.
33 USE_I18N = True
34
35 MEDIA_ROOT = os.path.join(topdir, 'media') + os.sep
36 MEDIA_URL = '/media/'
37
38 ADMIN_MEDIA_PREFIX = '/admin-media/'
39
40 import random
41 import string
42 key_chars = "%s%s%s" %(string.letters, string.digits, '+-()_#~')
43 SECRET_KEY = "".join([random.choice(key_chars) for a in range(0,50)])
44
45 # List of callables that know how to import templates from various sources.
46 TEMPLATE_LOADERS = (
47     'django.template.loaders.filesystem.Loader',
48     'django.template.loaders.app_directories.Loader',
49 )
50
51 MIDDLEWARE_CLASSES = (
52     'django.middleware.common.CommonMiddleware',
53     'django.contrib.sessions.middleware.SessionMiddleware',
54     'django.contrib.auth.middleware.AuthenticationMiddleware',
55 )
56
57 ROOT_URLCONF = 'urls'
58
59 TEMPLATE_DIRS = (
60     os.path.join(topdir, 'templates')
61 )
62
63 INSTALLED_APPS = (
64     'django.contrib.admin',
65     'django.contrib.auth',
66     'django.contrib.contenttypes',
67     'django.contrib.sessions',
68     'django.contrib.sites',
69     'recipes',
70 )
71
72 TEMPLATES = [
73     {
74         'BACKEND': 'django.template.backends.django.DjangoTemplates',
75         'DIRS': [os.path.join(topdir, 'templates'),],
76         'APP_DIRS': True,
77         'OPTIONS': {
78             'context_processors': [
79                 'django.contrib.auth.context_processors.auth',
80                 'django.core.context_processors.debug',
81                 'django.core.context_processors.i18n',
82                 'generic.context_processors.media',
83             ],
84             'debug': True,
85         },
86     },
87 ]
88
89
90 try:
91     from localsettings import *
92 except:
93     pass
94