Fix up for django 1.10
[sommitrealweird.git] / sommitrealweird / settings.py
1 # Django settings for sommitrealweird project.
2
3 # Rather than editing these here, add them to the localsettings.py file which
4 # will be included at the end of the run
5
6 import os
7
8 topdir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
9
10 ADMINS = (
11     ('Brett Parker', 'iDunno@sommitrealweird.co.uk'),
12 )
13
14 ALLOWED_HOSTS = [
15     "www.sommitrealweird.co.uk",
16     "www.sommitrealweird.co.uk.",
17 ]
18
19 MANAGERS = ADMINS
20
21 DATABASES = {
22     'default': {
23             'ENGINE': 'django.db.backends.sqlite3',
24             'NAME': os.path.join(topdir, 'sommitrealweird.db')
25     }
26 }
27
28 TIME_ZONE = 'Europe/London'
29
30 LANGUAGE_CODE = 'en-gb'
31
32 SITE_ID = 1
33
34 TEST_RUNNER = 'django.test.runner.DiscoverRunner'
35
36 # If you set this to False, Django will make some optimizations so as not
37 # to load the internationalization machinery.
38 USE_I18N = True
39
40 MEDIA_ROOT = os.path.join(topdir, 'media') + os.sep
41 MEDIA_URL = '/media/'
42
43 STATIC_URL = '/static/'
44
45 import random
46 import string
47 key_chars = "%s%s%s" % (string.letters, string.digits, '+-()_#~')
48 SECRET_KEY = [random.choice(key_chars) for a in range(0,50)]
49
50 CACHES = {
51     'default': {
52         'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
53         'LOCATION': '%s/tmp' %(topdir),
54     }
55 }
56
57 MIDDLEWARE_CLASSES = (
58     'django.middleware.common.CommonMiddleware',
59     'django.contrib.sessions.middleware.SessionMiddleware',
60     'django.contrib.auth.middleware.AuthenticationMiddleware',
61     'django.contrib.messages.middleware.MessageMiddleware',
62     'django.middleware.csrf.CsrfViewMiddleware',
63     'django.contrib.admindocs.middleware.XViewMiddleware',
64 )
65
66 ROOT_URLCONF = 'urls'
67
68 TEMPLATES = [
69     {
70         'BACKEND': 'django.template.backends.django.DjangoTemplates',
71         'DIRS': [os.path.join(topdir, 'templates'),],
72         'APP_DIRS': True,
73         'OPTIONS': {
74             'context_processors': [
75                 'django.contrib.auth.context_processors.auth',
76                 'django.template.context_processors.debug',
77                 'django.template.context_processors.i18n',
78                 'django.template.context_processors.media',
79                 'bpcms.context_processors.content_menu',
80                 'bpcms.context_processors.content_submenu',
81                 'bpcms.context_processors.content_breadcrumb',
82                 'blog.context_processors.content_breadcrumb',
83                 'blog.context_processors.blog_feed',
84                 'photo.context_processors.content_breadcrumb',
85             ],
86             'debug': True,
87         },
88     },
89 ]
90
91 INSTALLED_APPS = (
92     'django.contrib.auth',
93     'django.contrib.contenttypes',
94     'django.contrib.sessions',
95     'django.contrib.sites',
96     'django.contrib.admin',
97     'bpcms',
98     'generic',
99     'blog',
100     'photo',
101 )
102
103
104 APPEND_SLASH=False
105
106 RESTRUCTUREDTEXT_FILTER_SETTINGS = {
107     'initial_header_level': 2,
108     'doctitle_xform': False,
109 }
110
111 BPCMS_ROOT = '/'
112 BPCMS_DISALLOWED_ROOT_DOC_NAMES = (
113     'admin',
114     'blog',
115     'photos',
116 )
117
118 BLOG_ROOT = '/blog/'
119 BLOG_TITLE = u'The World of SommitRealWeird.'
120 BLOG_FEED_ROOT = '/feeds/blog/'
121
122 try:
123     from localsettings import *
124 except:
125     pass
126