diff --git a/kumisystems/settings.py b/kumisystems/settings.py index 5c2b8b4..aa0c6c0 100644 --- a/kumisystems/settings.py +++ b/kumisystems/settings.py @@ -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) diff --git a/manage.py b/manage.py index 0edd563..4d0d3ef 100755 --- a/manage.py +++ b/manage.py @@ -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__":