diff --git a/application/settings.py b/application/settings.py index 244d4fd..5eddd33 100644 --- a/application/settings.py +++ b/application/settings.py @@ -27,6 +27,7 @@ SECRET_KEY = os.getenv("SECRET_KEY") DEBUG = os.getenv("DEBUG") == "True" ALLOWED_HOSTS = ['127.0.0.1', 'localhost'] +LOGIN_URL = '/login/' # Allow requests coming through nginx on host:8080 (used in local Docker Compose) # Add any additional origins you use (including scheme and port) here. diff --git a/questions/static/core/js/script.js b/questions/static/core/js/script.js index b090a7f..15c5fc3 100644 --- a/questions/static/core/js/script.js +++ b/questions/static/core/js/script.js @@ -189,5 +189,9 @@ function initializeTitleFromQuery() { } } -// Run on ask page load -document.addEventListener('DOMContentLoaded', initializeTitleFromQuery); \ No newline at end of file +// Run immediately (script.js loads at end of page, DOMContentLoaded may have already fired) +if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', initializeTitleFromQuery); +} else { + initializeTitleFromQuery(); +} \ No newline at end of file diff --git a/questions/templates/core/layout/base.html b/questions/templates/core/layout/base.html index 46a4957..b920c6e 100644 --- a/questions/templates/core/layout/base.html +++ b/questions/templates/core/layout/base.html @@ -8,6 +8,15 @@ +