Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add django-prometheus DB backends support #1800

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

Merged
merged 2 commits into from
Apr 5, 2025

Conversation

mounirmesselmeni
Copy link
Contributor

List of backends provided by django-prometheus:

https://github.com/korfuri/django-prometheus/tree/master/django_prometheus/db/backends

This will fix the issue of not being able to reset_db as the backend is unknown.

A workaround I was using in settings.py it the following:

if 'reset_db' not in sys.argv:
    DATABASES['default']['ENGINE'] = DATABASES['default']['ENGINE'].replace(
        'django.db.backends', 'django_prometheus.db.backends'
    )

List of backends provided by django-prometheus:

https://github.com/korfuri/django-prometheus/tree/master/django_prometheus/db/backends

This will fix the issue of not being able to reset_db as the backend is unknown.

A workaround I was using in `settings.py` it the following:

```python
if 'reset_db' not in sys.argv:
    DATABASES['default']['ENGINE'] = DATABASES['default']['ENGINE'].replace(
        'django.db.backends', 'django_prometheus.db.backends'
    )
```
@trbs trbs merged commit a6f4e3b into django-extensions:main Apr 5, 2025
12 checks passed
@trbs
Copy link
Member

trbs commented Apr 5, 2025

Thanks !

@mounirmesselmeni mounirmesselmeni deleted the patch-2 branch April 7, 2025 14:07
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

Successfully merging this pull request may close these issues.

2 participants