Skip to content

Commit

Permalink
Fix allowing website to finally deploy properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Kubaryt committed Apr 2, 2024
1 parent f5f1acc commit 2c67e9a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions gwardia_hub/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = os.environ["SECRET_KEY"]
SECRET_KEY = os.environ.get("SECRET_KEY", "django-insecure-4j1$hggp9)@sf0^*#c!#^p#$$@@t%rvk1d*8u9epdbec1o=qb!")

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = os.environ.get("DJANGO_DEBUG", "") != "0"

ALLOWED_HOSTS = []

RENDER_EXTERNAL_HOSTNAME = os.environ.get('RENDER_EXTERNAL_HOSTNAME')
RENDER_EXTERNAL_HOSTNAME = os.environ.get("RENDER_EXTERNAL_HOSTNAME")
if RENDER_EXTERNAL_HOSTNAME:
ALLOWED_HOSTS.append(RENDER_EXTERNAL_HOSTNAME)

Expand All @@ -53,7 +53,7 @@
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
'whitenoise.middleware.WhiteNoiseMiddleware',
"whitenoise.middleware.WhiteNoiseMiddleware",
]

ROOT_URLCONF = "gwardia_hub.urls"
Expand Down Expand Up @@ -81,7 +81,7 @@

DATABASES = {
"default": dj_database_url.config(
default='postgresql://root:root@localhost:5432/gwardiahub',
default="postgresql://root:root@localhost:5432/gwardiahub",
conn_max_age=600
),
}
Expand Down Expand Up @@ -128,7 +128,7 @@
STATIC_ROOT = BASE_DIR / "staticfiles"
# Enable the WhiteNoise storage backend, which compresses static files to reduce disk use
# and renames the files with unique names for each version to support long-term caching
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"

# Default primary key field type
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
Expand Down
2 changes: 1 addition & 1 deletion render.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ services:
value: 4
- key: POETRY_VERSION
value: 1.8.2
- key: DEBUG
- key: DJANGO_DEBUG
value: 0

0 comments on commit 2c67e9a

Please sign in to comment.