]> git.sommitrealweird.co.uk Git - sommitrealweird.git/blob - sommitrealweird/settings.py
Changes to make it work with django 1.11 and python3
[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_ROOT = '/usr/lib/python3/dist-packages/django/contrib/admin/static/'
44 STATIC_URL = '/static/'
45
46 import random
47 import string
48 key_chars = "%s%s%s" % (string.ascii_letters, string.digits, '+-()_#~')
49 SECRET_KEY = [random.choice(key_chars) for a in range(0,50)]
50
51 CACHES = {
52     'default': {
53         'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
54         'LOCATION': '%s/tmp' %(topdir),
55     }
56 }
57
58 MIDDLEWARE_CLASSES = (
59     'django.middleware.common.CommonMiddleware',
60     'django.contrib.sessions.middleware.SessionMiddleware',
61     'django.contrib.auth.middleware.AuthenticationMiddleware',
62     'django.contrib.messages.middleware.MessageMiddleware',
63     'django.middleware.csrf.CsrfViewMiddleware',
64     'django.contrib.admindocs.middleware.XViewMiddleware',
65 )
66
67 ROOT_URLCONF = 'urls'
68
69 TEMPLATES = [
70     {
71         'BACKEND': 'django.template.backends.django.DjangoTemplates',
72         'DIRS': [os.path.join(topdir, 'templates'),],
73         'APP_DIRS': True,
74         'OPTIONS': {
75             'context_processors': [
76                 'django.contrib.auth.context_processors.auth',
77                 'django.contrib.messages.context_processors.messages',
78                 'django.template.context_processors.debug',
79                 'django.template.context_processors.i18n',
80                 'django.template.context_processors.media',
81                 'bpcms.context_processors.content_menu',
82                 'bpcms.context_processors.content_submenu',
83                 'bpcms.context_processors.content_breadcrumb',
84                 'blog.context_processors.content_breadcrumb',
85                 'blog.context_processors.blog_feed',
86                 'photo.context_processors.content_breadcrumb',
87             ],
88             'debug': True,
89         },
90     },
91 ]
92
93 INSTALLED_APPS = (
94     'django.contrib.auth',
95     'django.contrib.contenttypes',
96     'django.contrib.sessions',
97     'django.contrib.sites',
98     'django.contrib.admin',
99     'bpcms',
100     'generic',
101     'blog',
102     'photo',
103 )
104
105
106 APPEND_SLASH=False
107
108 RESTRUCTUREDTEXT_FILTER_SETTINGS = {
109     'initial_header_level': 2,
110     'doctitle_xform': False,
111 }
112
113 BPCMS_ROOT = '/'
114 BPCMS_DISALLOWED_ROOT_DOC_NAMES = (
115     'admin',
116     'blog',
117     'photos',
118 )
119
120 BLOG_ROOT = '/blog/'
121 BLOG_TITLE = u'The World of SommitRealWeird.'
122 BLOG_FEED_ROOT = '/feeds/blog/'
123
124 try:
125     from localsettings import *
126 except:
127     pass
128