diff --git a/apiserver/apiserver/api/admin.py b/apiserver/apiserver/api/admin.py index 8c38f3f..db4e876 100644 --- a/apiserver/apiserver/api/admin.py +++ b/apiserver/apiserver/api/admin.py @@ -1,3 +1,10 @@ +from django.apps import apps from django.contrib import admin +from django.contrib.admin.sites import AlreadyRegistered -# Register your models here. +app_models = apps.get_app_config('api').get_models() +for model in app_models: + try: + admin.site.register(model) + except AlreadyRegistered: + pass