-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected SystemSettings interaction causing failure to run via wsgi.py #11660
Comments
@jacobtylerwalls thanks for the deep investigation and diagnosis! |
Throwing out ideas for better heuristics for "is the currently running Django project core arches itself?": this should only evaluate True for running core arches, but it's a little fiddly: >>> from pathlib import Path
>>> from django.conf import settings
>>> Path(settings.APP_ROOT).parent == Path(settings.ROOT_DIR)
True |
Also worth looking into whether core urls.py can just do the same check that's working well in projects? if settings.ROOT_URLCONF == __name__: |
This check sniffs for whether this urls.py is the one being run as a project (not included by any further apps). For core arches, this would only be true if running core arches without a project. This was failing on a Django exception inside i18n_patterns(). This check is the same check that we're using in project-level settings.py
This check sniffs for whether this urls.py is the one being run as a project (not included by any further apps). For core arches, this would only be true if running core arches without a project. This was failing on a Django exception inside i18n_patterns(). This check is the same check that we're using in project-level settings.py
…es" #11660 (#11687) * Use same guard for "last" project as project-level urls.py #11660 This check sniffs for whether this urls.py is the one being run as a project (not included by any further apps). For core arches, this would only be true if running core arches without a project. This was failing on a Django exception inside i18n_patterns(). This check is the same check that we're using in project-level settings.py * Also avoid checking APP_NAME in generate_frontend_configuration()
I'll open follow-ups for anything not addressed in 7.6.4. |
@ekansa reported on the forum a failure to run an arches project via
wsgi.py
, i.e. not run withrunserver
. The TL;DR is that we have the default value ofAPP_NAME
being stored in a system settings tile and overriding the project settings file, only under wsgi.py.Traced it to this unexpectedly evaluating True:
arches/arches/urls.py
Line 789 in f3390ef
... because wsgi.py loads system settings from the database:
arches/arches/wsgi.py
Line 39 in f3390ef
... and we save the value "Arches" for
APP_NAME
in the database duringsetup_db
, which is going to be incorrect for all cases (only applies to running "naked" core arches like a project):arches/arches/db/system_settings/Arches_System_Settings.json
Lines 153 to 156 in f3390ef
arches/arches/management/commands/setup_db.py
Lines 234 to 236 in f3390ef
@chrabyrd and I didn't notice this when developing f569e09 and related features because we were running the devserver, but arguably this is an orthogonal bug.
We have other cases where we need the value of APP_NAME to be correct:
arches/arches/settings_utils.py
Lines 161 to 162 in f3390ef
I reproduced on 7.6.3 with Eric's instructions:
DEPLOY_HOST
in settings_local since there wasn't a fallbacknpm i [email protected]
to the build development command to work around vue-tsc doesn't work with typescript 5.7.2 vuejs/language-tools#5018. (This will hopefully disappear in a few days.)Next steps
A workaround is to comment out the last line of wsgi.py that calls
update_from_db()
, or updating the invalid tile value in pg directly. But regardless of the wisdom of that, there a few things to look into, some of which shouldn't be done in a patch?cc/ @aarongundel
The text was updated successfully, but these errors were encountered: