Changes for django 2.2
[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     "10.0.3.191",
18 ]
19
20 MANAGERS = ADMINS
21
22 DATABASES = {
23     'default': {
24             'ENGINE': 'django.db.backends.sqlite3',
25             'NAME': os.path.join(topdir, 'sommitrealweird.db')
26     }
27 }
28
29 TIME_ZONE = 'Europe/London'
30
31 LANGUAGE_CODE = 'en-gb'
32
33 SITE_ID = 1
34
35 TEST_RUNNER = 'django.test.runner.DiscoverRunner'
36
37 # If you set this to False, Django will make some optimizations so as not
38 # to load the internationalization machinery.
39 USE_I18N = True
40
41 MEDIA_ROOT = os.path.join(topdir, 'media') + os.sep
42 MEDIA_URL = '/media/'
43
44 STATIC_ROOT = '/usr/lib/python3/dist-packages/django/contrib/admin/static/'
45 STATIC_URL = '/static/'
46
47 import random
48 import string
49 key_chars = "%s%s%s" % (string.ascii_letters, string.digits, '+-()_#~')
50 SECRET_KEY = [random.choice(key_chars) for a in range(0,50)]
51
52 CACHES = {
53     'default': {
54         'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
55         'LOCATION': '%s/tmp' %(topdir),
56     }
57 }
58
59 MIDDLEWARE = (
60     'django.middleware.common.CommonMiddleware',
61     'django.contrib.sessions.middleware.SessionMiddleware',
62     'django.contrib.auth.middleware.AuthenticationMiddleware',
63     'django.contrib.messages.middleware.MessageMiddleware',
64     'django.middleware.csrf.CsrfViewMiddleware',
65     'django.contrib.admindocs.middleware.XViewMiddleware',
66 )
67
68 ROOT_URLCONF = 'urls'
69
70 TEMPLATES = [
71     {
72         'BACKEND': 'django.template.backends.django.DjangoTemplates',
73         'DIRS': [os.path.join(topdir, 'templates'),],
74         'APP_DIRS': True,
75         'OPTIONS': {
76             'context_processors': [
77                 'django.contrib.auth.context_processors.auth',
78                 'django.contrib.messages.context_processors.messages',
79                 'django.template.context_processors.debug',
80                 'django.template.context_processors.i18n',
81                 'django.template.context_processors.media',
82                 'bpcms.context_processors.content_menu',
83                 'bpcms.context_processors.content_submenu',
84                 'bpcms.context_processors.content_breadcrumb',
85                 'blog.context_processors.content_breadcrumb',
86                 'blog.context_processors.blog_feed',
87                 'photo.context_processors.content_breadcrumb',
88             ],
89             'debug': True,
90         },
91     },
92 ]
93
94 INSTALLED_APPS = (
95     'django.contrib.auth',
96     'django.contrib.contenttypes',
97     'django.contrib.sessions',
98     'django.contrib.sites',
99     'django.contrib.admin',
100     'django.contrib.messages',
101     'bpcms',
102     'generic',
103     'blog',
104     'photo',
105 )
106
107
108 APPEND_SLASH=False
109
110 RESTRUCTUREDTEXT_FILTER_SETTINGS = {
111     'initial_header_level': 2,
112     'doctitle_xform': False,
113 }
114
115 BPCMS_ROOT = '/'
116 BPCMS_DISALLOWED_ROOT_DOC_NAMES = (
117     'admin',
118     'blog',
119     'photos',
120 )
121
122 BLOG_ROOT = '/blog/'
123 BLOG_TITLE = u'The World of SommitRealWeird.'
124 BLOG_FEED_ROOT = '/feeds/blog/'
125
126 try:
127     from localsettings import *
128 except:
129     pass
130