Skip to content

Commit

Permalink
Added settings for production environments.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmccully committed Nov 21, 2024
1 parent 966b85d commit 789d7d2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 0 additions & 1 deletion banzai_floyds_ui/gui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from banzai_floyds.frames import FLOYDSFrameFactory
from banzai_floyds import settings
from django.conf import settings as django_settings
from banzai_floyds.utils.profile_utils import profile_fits_to_data
import os
import banzai.main
import io
Expand Down
13 changes: 9 additions & 4 deletions banzai_floyds_ui/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,18 @@
# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-0*$4nwm8zd$jcc*xlwm$2nm_=r6bn5rv@#k7jrta^dy&c*3)(y'
SECRET_KEY = os.getenv('SECRET_KEY', 'django-insecure-0*$4nwm8zd$jcc*xlwm$2nm_=r6bn5rv@#k7jrta^dy&c*3)(y')

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = os.getenv('DEBUG', False)

ALLOWED_HOSTS = ['*']
ALLOWED_HOSTS = os.getenv('ALLOWED_HOSTS', '*').split(',')

SECURE_SSL_REDIRECT = not DEBUG

SESSION_COOKIE_SECURE = not DEBUG

CSRF_COOKIE_SECURE = not DEBUG

# Application definition

Expand Down Expand Up @@ -93,7 +98,7 @@
'default':
{
'BACKEND': 'django_redis.cache.RedisCache',
"LOCATION": os.environ['REDIS_URL'],
"LOCATION": f"redis://{os.eniron['REDIS_HOST']}/{os.environ['REDIS_PORT']}",
'OPTIONS': {'CLIENT_CLASS': 'django_redis.client.DefaultClient'}
}
}
Expand Down

0 comments on commit 789d7d2

Please sign in to comment.