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