just change:from django.contrib import adminfrom models import *import modelsimport inspectfrom django.db.models.base import ModelBasefrom django.contrib.admin.sites import AlreadyRegisteredfor name, obj in inspect.getmembers(models ):if inspect.isclass(obj):if isinstance(obj, ModelBase):if not obj._meta.abstract:try:admin.site.register(obj)except AlreadyRegistered:pass
from models import *
import models
and
inspect.getmembers(models )