v2.2.0 fails to run; returns ImproperlyConfigured #1291

Closed
opened 2025-12-29 16:31:08 +01:00 by adam · 1 comment
Owner

Originally created by @jeremystretch on GitHub (Oct 12, 2017).

Issue type

[ ] Feature request
[x] Bug report
[ ] Documentation

Environment

  • Python version: 3.4.3
  • NetBox version: 2.2.0

Description

The NetBox WSGI service fails to start, returning the following error:

ImproperlyConfigured: Requested setting DATABASES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

This issue has been traced to code intended to verify the PostgreSQL database version during initialization. However, the required settings variable is not available at the time of execution.

This issues does not affect the development server (manage.py runserver).

Originally created by @jeremystretch on GitHub (Oct 12, 2017). ### Issue type [ ] Feature request <!-- Requesting the implementation of a new feature --> [x] Bug report <!-- Reporting unexpected or erroneous behavior --> [ ] Documentation <!-- Proposing a modification to the documentation --> ### Environment * Python version: 3.4.3 * NetBox version: 2.2.0 ### Description The NetBox WSGI service fails to start, returning the following error: ``` ImproperlyConfigured: Requested setting DATABASES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings. ``` This issue has been traced to code intended to verify the PostgreSQL database version during initialization. However, the required `settings` variable is not available at the time of execution. This issues does not affect the development server (`manage.py runserver`).
adam added the type: bug label 2025-12-29 16:31:08 +01:00
adam closed this issue 2025-12-29 16:31:08 +01:00
Author
Owner

@jeremystretch commented on GitHub (Oct 12, 2017):

The logic which validates the PostgreSQL database version has been moved out of the main code and into the relevant migration (extras.0008_reports), which will run only when the migration is applied.

@jeremystretch commented on GitHub (Oct 12, 2017): The logic which validates the PostgreSQL database version has been moved out of the main code and into the relevant migration (`extras.0008_reports`), which will run only when the migration is applied.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1291