I’m encountering an issue with a Django application. I created a model and registered it in the admin. Everything works fine locally and I can see the model in the admin interface, but in production, it doesn’t appear.
- I have verified that the migrations have been applied correctly both locally and in production. I used showmigrations and everything seems to be in order.
- I checked the production database via shell_plus and the model’s table exists. I also created a record manually to ensure it works.
- My admin.py is configured correctly and looks identical in both the local and production environments.
# admin.py
from django.contrib import admin
from myapp.models import MyModel
@admin.register(MyModel)
class MyModelAdmin(admin.ModelAdmin):
list_display = ('field1', 'field2', 'field3')
I cleared the browser cache and tried a different browser, but nothing changed.
I can’t figure out why the model doesn’t appear in the admin in production. Any suggestions on what I might check or do to resolve this issue?