Fix allowed hosts
This commit is contained in:
parent
a6f0f8cd07
commit
f45f7bdac4
2 changed files with 8 additions and 2 deletions
|
@ -16,7 +16,13 @@ DEBUG = CONFIG.get('KumiSystems', 'Debug', fallback=False)
|
|||
|
||||
HOST = CONFIG.get('KumiSystems', 'Host', fallback='localhost')
|
||||
ALLOWED_HOSTS = [HOST]
|
||||
CSRF_TRUSTED_ORIGINS = [f"https://{HOST}"]
|
||||
|
||||
if HOST.startswith("www."):
|
||||
ALLOWED_HOSTS.append(HOST[4:])
|
||||
else:
|
||||
ALLOWED_HOSTS.append(f"www.{HOST}")
|
||||
|
||||
CSRF_TRUSTED_ORIGINS = [f"https://{HOST}" for HOST in ALLOWED_HOSTS]
|
||||
|
||||
SITE_ID = CONFIG.getint('KumiSystems', 'SiteID', fallback=1)
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ def main():
|
|||
"available on your PYTHONPATH environment variable? Did you "
|
||||
"forget to activate a virtual environment?"
|
||||
) from exc
|
||||
execute_from_command_line(sys.argv)
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Reference in a new issue