admin.py
PTC-W0903Admin classes not in an app's admin.py
can cause circular import problems throughout a project.
This is because registering an admin class implies a call to models.get_apps()
which attempts to import every models.py
in the project.
Whilst your project should probably not have significant inter-app dependencies, importing every possible models.py does not help the situation and can cause ImportError
when models are loaded in different scenarios.
Registering admin classes in admin.py
is standard practice of django developers. It is recommended to have predictable project structure and follow common patterns. This simplifies maintenance of a codebase.