Admin class not in admin.py

Predictable project structure and following common patterns simplifies maintenance of a codebase.

Django developers come to expect Admin-related objects to be in admin.py. Failure to do this will result in more time spent looking for where code lives.

If our GitHub code review bot spots this issue in your pull request it gives this advice:

django-doctorbotsuggested changes just now
views.py → admin.py
1
+
from django.contrib import admin
2
+
from . import models
3
+
	
4
+
admin.site.register(models.Author)

Predictable project structure and following common patterns simplifies maintenance of a codebase.

Django developers come to expect Admin-related objects to be in admin.py. Failure to do this will result in more time spent looking for where code lives.

Read more
Update views.py → admin.py

Instantly check if you have this issue for free

    Works with tools you use

    Read about how it works.