lundi 23 mars 2015

Django: How to debug this admin bug? Form not rendered

I am facing a very strange problem. I have a Django project which runs fine in four environments (development, testing, staging and production), besides one strange bug.


In the production environment, the change form for a single model isn't rendered anymore. The rendered html page only contains the csrf token and then the submit buttons. All other change forms for other models are rendered just fine.


The result looks like this: enter image description here


I am running the same code based (same commit and branch) on an identical staging server, and everything looks fine.


What could cause the faulty rendering of the form? How can I further debug it?


This is what I tried so far:



  1. I switched back to a commit where I was absolutely sure that the admin change form worked. Form still not rendered.

  2. I compared the pip packages between the Staging and Production. Both are identical (Django 1.7.1)

  3. I checked the log files on the dev server. No Django error found.


I am running out of ideas how to debug this issue. Any suggestions?


Update March 23rd


It turns out that setting DEBUG=True, let's Django rendering the form. If DEBUG=True, the form rendering is failing silently. Why is that?


Aucun commentaire:

Enregistrer un commentaire