Skip to content
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

Accessing the database during app initialization #612

Closed
spapas opened this issue Apr 25, 2024 · 2 comments
Closed

Accessing the database during app initialization #612

spapas opened this issue Apr 25, 2024 · 2 comments

Comments

@spapas
Copy link
Contributor

spapas commented Apr 25, 2024

After ugprading to the latest version (django-sql-explorer==4.1) I had to install sql-metadata (see #610), however after that I'm getting this warning:

C:\progr\py3\ehcg\venv\lib\site-packages\django\db\backends\utils.py:98: RuntimeWarning: Accessing the database during app initialization is discouraged. To fix this warning, avoid executing queries in AppConfig.ready() or when your app modules are imported.

The warning is from the track_summary_stats that you have on the ExplorerAppConfig.

@chrisclark
Copy link
Collaborator

Interesting. That is new in Django 5 and I didn't catch in testing. I will address alongside the other 4.1 issues and push a 4.2. This will require a new model to store a high-water-mark setting.

@chrisclark chrisclark mentioned this issue Apr 25, 2024
Merged
@chrisclark
Copy link
Collaborator

Addressed in #611

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants