]> git.sommitrealweird.co.uk Git - sommitrealweird.git/blobdiff - sommitrealweird/settings.py
Update for newer django
[sommitrealweird.git] / sommitrealweird / settings.py
index 723ff4d0eda2fd31e96379c2f708a76d1be2665a..0f8dae97106036169c75c64066a1af9d4a3c6f58 100644 (file)
@@ -14,6 +14,9 @@ ADMINS = (
 ALLOWED_HOSTS = [
     "www.sommitrealweird.co.uk",
     "www.sommitrealweird.co.uk.",
 ALLOWED_HOSTS = [
     "www.sommitrealweird.co.uk",
     "www.sommitrealweird.co.uk.",
+    "10.0.3.191",
+    "127.0.0.1",
+    "localhost",
 ]
 
 MANAGERS = ADMINS
 ]
 
 MANAGERS = ADMINS
@@ -25,6 +28,11 @@ DATABASES = {
     }
 }
 
     }
 }
 
+DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
+
+DEBUG = True
+
+
 TIME_ZONE = 'Europe/London'
 
 LANGUAGE_CODE = 'en-gb'
 TIME_ZONE = 'Europe/London'
 
 LANGUAGE_CODE = 'en-gb'
@@ -40,39 +48,55 @@ USE_I18N = True
 MEDIA_ROOT = os.path.join(topdir, 'media') + os.sep
 MEDIA_URL = '/media/'
 
 MEDIA_ROOT = os.path.join(topdir, 'media') + os.sep
 MEDIA_URL = '/media/'
 
+STATIC_ROOT = '/home/brettp/python-envs/django/lib/python3.11/site-packages/django/contrib/admin/static/'
 STATIC_URL = '/static/'
 
 import random
 import string
 STATIC_URL = '/static/'
 
 import random
 import string
-key_chars = "%s%s%s" % (string.letters, string.digits, '+-()_#~')
+key_chars = "%s%s%s" % (string.ascii_letters, string.digits, '+-()_#~')
 SECRET_KEY = [random.choice(key_chars) for a in range(0,50)]
 
 CACHES = {
     'default': {
         'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
 SECRET_KEY = [random.choice(key_chars) for a in range(0,50)]
 
 CACHES = {
     'default': {
         'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
-         'LOCATION': '%s/tmp' %(topdir),
+        'LOCATION': '%s/tmp' %(topdir),
     }
 }
 
     }
 }
 
-TEMPLATE_LOADERS = (
-    'django.template.loaders.filesystem.Loader',
-    'django.template.loaders.app_directories.Loader',
-)
-
-MIDDLEWARE_CLASSES = (
+MIDDLEWARE = (
     'django.middleware.common.CommonMiddleware',
     'django.contrib.sessions.middleware.SessionMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     'django.contrib.messages.middleware.MessageMiddleware',
     'django.middleware.csrf.CsrfViewMiddleware',
     'django.middleware.common.CommonMiddleware',
     'django.contrib.sessions.middleware.SessionMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     'django.contrib.messages.middleware.MessageMiddleware',
     'django.middleware.csrf.CsrfViewMiddleware',
-    'django.contrib.admindocs.middleware.XViewMiddleware',
 )
 
 ROOT_URLCONF = 'urls'
 
 )
 
 ROOT_URLCONF = 'urls'
 
-TEMPLATE_DIRS = (
-    os.path.join(topdir, 'templates'),
-)
+TEMPLATES = [
+    {
+        'BACKEND': 'django.template.backends.django.DjangoTemplates',
+        'DIRS': [os.path.join(topdir, 'templates'),],
+        'APP_DIRS': True,
+        'OPTIONS': {
+            'context_processors': [
+                'django.template.context_processors.request',
+                'django.contrib.auth.context_processors.auth',
+                'django.contrib.messages.context_processors.messages',
+                'django.template.context_processors.debug',
+                'django.template.context_processors.i18n',
+                'django.template.context_processors.media',
+                'bpcms.context_processors.content_menu',
+                'bpcms.context_processors.content_submenu',
+                'bpcms.context_processors.content_breadcrumb',
+                'blog.context_processors.content_breadcrumb',
+                'blog.context_processors.blog_feed',
+                'photo.context_processors.content_breadcrumb',
+            ],
+            'debug': True,
+        },
+    },
+]
 
 INSTALLED_APPS = (
     'django.contrib.auth',
 
 INSTALLED_APPS = (
     'django.contrib.auth',
@@ -80,25 +104,13 @@ INSTALLED_APPS = (
     'django.contrib.sessions',
     'django.contrib.sites',
     'django.contrib.admin',
     'django.contrib.sessions',
     'django.contrib.sites',
     'django.contrib.admin',
-    'django.contrib.comments',
+    'django.contrib.messages',
     'bpcms',
     'generic',
     'blog',
     'photo',
 )
 
     'bpcms',
     'generic',
     'blog',
     'photo',
 )
 
-TEMPLATE_CONTEXT_PROCESSORS = (
-    'django.contrib.auth.context_processors.auth',
-    'django.core.context_processors.debug',
-    'django.core.context_processors.i18n',
-    'generic.context_processors.media',
-    'bpcms.context_processors.content_menu',
-    'bpcms.context_processors.content_submenu',
-    'bpcms.context_processors.content_breadcrumb',
-    'blog.context_processors.content_breadcrumb',
-    'blog.context_processors.blog_feed',
-    'photo.context_processors.content_breadcrumb',
-)
 
 APPEND_SLASH=False
 
 
 APPEND_SLASH=False