Get site running on staging domain.

This commit is contained in:
jmsgrogan 2024-02-18 17:20:38 +00:00
parent 4be5e93c9c
commit 7ba077608c
5 changed files with 49 additions and 11 deletions

View file

@ -3,4 +3,5 @@
content="width=device-width, initial-scale=1">
{% load static %}
<link rel="shortcut icon" type="image/png" href="{% static 'primary/favicon.ico' %}"/>
<link rel="stylesheet" href="{% static 'primary/style.css' %}">

View file

@ -22,9 +22,11 @@ BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = os.environ.get("SECRET_KEY")
DEBUG = bool(os.environ.get("DEBUG", default=0))
#DEBUG = bool(os.environ.get("DEBUG", default=0))
#DEBUG=True
ALLOWED_HOSTS = os.environ.get("DJANGO_ALLOWED_HOSTS").split(" ")
if "DJANGO_ALLOWED_HOSTS" in os.environ:
ALLOWED_HOSTS = os.environ.get("DJANGO_ALLOWED_HOSTS").split(" ")
# Application definition
@ -112,17 +114,27 @@ USE_I18N = True
USE_TZ = True
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
CSRF_TRUSTED_ORIGINS = os.environ.get("CSRF_TRUSTED_ORIGINS").split(" ")
if "CSRF_TRUSTED_ORIGINS" in os.environ:
CSRF_TRUSTED_ORIGINS = os.environ.get("CSRF_TRUSTED_ORIGINS").split(" ")
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.0/howto/static-files/
STATIC_URL = 'static/'
STATIC_ROOT = BASE_DIR / "staticfiles"
if "DJANGO_STATIC_ROOT" in os.environ:
STATIC_ROOT = os.environ.get("DJANGO_STATIC_ROOT")
else:
STATIC_ROOT = BASE_DIR / "staticfiles"
MEDIA_URL = 'media/'
MEDIA_ROOT = BASE_DIR / "mediafiles"
if "DJANGO_MEDIA_ROOT" in os.environ:
MEDIA_ROOT = os.environ.get("DJANGO_MEDIA_ROOT")
else:
MEDIA_ROOT = BASE_DIR / "mediafiles"
# Default primary key field type
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field