Reputation: 3506
I have a model with a bunch of fields, and after deploying to production, the django admin shows no fields for that specific model, like at all.
I see the top title "Change MODELNAME", and the bottom toolbar with the save buttons. But when i click save, i get a validation error, but still no fields.
I get no errors, it's just not showing.
The issue occurred after changing something unrelated in the database, and minor changes in the code. But from what i can see, nothing related to the admin.
Also the most weird part, it works when running locally using a local database (using postgres in both production and dev env).
Django version 1.11.6
EDIT:
It seems a "warning" was logged, and i only get emails on errors.... Found this in the log file.
django.template: Exception raised while rendering {% include %} for template 'admin/change_form.html'
Upvotes: 1
Views: 548
Reputation: 3506
Solved the issue.
I had model B (which was associated to my Device model) where the unicode method accidentally returned nothing, ie None, and the django admin form failed when it attempted to render the string representation of the model, inside the dropdown on the Device model - which makes the whole form fail when rendering.
That really should be an error, and not a warning IMO, as the rendering should not just use an empty string as fallback when it happens.
Upvotes: 1