You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It quietly ignores issues with reading the db.conf config, to ensure NAV code can still be imported during development or unit testing, when no database is actually running.
However, this masks issues with getting parts of NAV to run in production. E.g. if the NAV web app doesn't run with the necessary privilege level to read db.conf, the app will crash with only a generic Django ImproperlyConfigured error for the DATABASES setting - leaving the user to figure out for themselves what the actual underlying problem is.
Solution
The exception handler needs to be there, due to the reasons described above, but it should at least output a warning containing a description of the caught exception, so the problem will be easier to track down for an end user.
The text was updated successfully, but these errors were encountered:
This code handles configuration of the
DATABASES
Django setting from NAV's standarddb.conf
file:nav/python/nav/django/settings.py
Lines 51 to 70 in 6b359de
It quietly ignores issues with reading the
db.conf
config, to ensure NAV code can still be imported during development or unit testing, when no database is actually running.However, this masks issues with getting parts of NAV to run in production. E.g. if the NAV web app doesn't run with the necessary privilege level to read
db.conf
, the app will crash with only a generic DjangoImproperlyConfigured
error for theDATABASES
setting - leaving the user to figure out for themselves what the actual underlying problem is.Solution
The exception handler needs to be there, due to the reasons described above, but it should at least output a warning containing a description of the caught exception, so the problem will be easier to track down for an end user.
The text was updated successfully, but these errors were encountered: