Skip to content

Commit

Permalink
midna: fix domain logic
Browse files Browse the repository at this point in the history
ALLOWED HOSTS is mandatory for non debug env
  • Loading branch information
darakeon committed Jul 15, 2023
1 parent 866cb49 commit e003c76
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions midna/src/midna/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@
DEBUG = 'DEBUG' in environ and environ['DEBUG'] == 'true'


if 'DOMAIN' in environ:
if DEBUG:
ALLOWED_HOSTS = []
elif 'DOMAIN' in environ:
ALLOWED_HOSTS = [environ['DOMAIN']]
else:
ALLOWED_HOSTS = []
raise RuntimeError('Could not find a DOMAIN in environment')


# Application definition
Expand Down
1 change: 1 addition & 0 deletions publish/dfm-midna.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ RUN SECRET_KEY=collectstatic \
DATABASE_PASS= \
DATABASE_HOST= \
DATABASE_PORT= \
DOMAIN=collectstatic \
python3 manage.py collectstatic

CMD cp -r ../static/inside/* ../static/outside && gunicorn -c ../config/prod.py

0 comments on commit e003c76

Please sign in to comment.