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 167b674 commit e263f62
Showing 1 changed file with 4 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

0 comments on commit e263f62

Please sign in to comment.