kadenios/shared/admin.py

14 lines
332 B
Python
Raw Normal View History

from django.apps import apps
from django.conf import settings
from django.contrib import admin
2024-07-09 08:46:06 +02:00
from django.contrib.admin.sites import AlreadyRegistered
if settings.DEBUG:
models = apps.get_models()
for model in models:
try:
admin.site.register(model)
2024-07-09 08:46:06 +02:00
except AlreadyRegistered:
pass