Simplify settings and move some standard settings into settings.py

These were previously in djangocommonsettings.py, but don't ever vary between
development and production environments.
This commit is contained in:
Ben Sturmfels 2023-10-26 12:28:29 +11:00
parent 2f3fba359f
commit 70b8aa07ae
Signed by: bsturmfels
GPG key ID: 023C05E2C9C068F0
3 changed files with 9 additions and 2 deletions

View file

@ -59,7 +59,7 @@ class Entry(models.Model, bsoup.SoupModelMixin):
# Ping google blogs and technorati. Taken from # Ping google blogs and technorati. Taken from
# http://blog.foozia.com/blog/2007/apr/21/ping-technorati-your-django-blog-using-xml-rpc/ # http://blog.foozia.com/blog/2007/apr/21/ping-technorati-your-django-blog-using-xml-rpc/
def save(self): def save(self):
if settings.CONSERVANCY_DEVEL or True: # "or True" means it is disabled always if settings.DEBUG or True: # "or True" means it is disabled always
super().save() super().save()
return return

View file

@ -47,7 +47,7 @@ class PressRelease(models.Model, bsoup.SoupModelMixin):
return self.pub_date > (datetime.now() - timedelta(days=30)) return self.pub_date > (datetime.now() - timedelta(days=30))
def save(self): def save(self):
if settings.CONSERVANCY_DEVEL or True: if settings.DEBUG or True:
super().save() super().save()
return return

View file

@ -127,11 +127,18 @@ TEMPLATES = [
} }
] ]
# Internationalization
TIME_ZONE = 'America/New_York'
LANGUAGE_CODE = 'en-us'
STATIC_URL = '/static/'
STATIC_ROOT = BASE_DIR.parent / 'collected_static' STATIC_ROOT = BASE_DIR.parent / 'collected_static'
STATICFILES_DIRS = [ STATICFILES_DIRS = [
BASE_DIR / 'static', BASE_DIR / 'static',
] ]
MEDIA_URL = '/media/'
MIDDLEWARE = [ MIDDLEWARE = [
'django.middleware.common.CommonMiddleware', 'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',