from django.apps import apps
from django.conf import settings
from django.contrib import admin
from django.contrib.admin.sites import AlreadyRegistered

# Registers all models for admin
for appname in settings.ADMIN_REGISTER_APPS:
    myapp = apps.get_app_config(appname)
    for model in myapp.get_models():
        try:
            admin.site.register(model)
        except AlreadyRegistered:
            pass

22087d58a283257bfebb20d710ceaee061026ae0
<mask token>

<mask token>
for appname in settings.ADMIN_REGISTER_APPS:
    myapp = apps.get_app_config(appname)
    for model in myapp.get_models():
        try:
            admin.site.register(model)
        except AlreadyRegistered:
            pass

from django.apps import apps
from django.conf import settings
from django.contrib import admin
from django.contrib.admin.sites import AlreadyRegistered
for appname in settings.ADMIN_REGISTER_APPS:
    myapp = apps.get_app_config(appname)
    for model in myapp.get_models():
        try:
            admin.site.register(model)
        except AlreadyRegistered:
            pass

from django.apps import apps
from django.conf import settings
from django.contrib import admin
from django.contrib.admin.sites import AlreadyRegistered

# Registers all models for admin
for appname in settings.ADMIN_REGISTER_APPS:
    myapp = apps.get_app_config(appname)
    for model in myapp.get_models():
        try:
            admin.site.register(model)
        except AlreadyRegistered:
            pass
