Last Updated: February 25, 2016
· jay-johnson

Fun and Obscure Django 500 errors

I learned the hard way when I tried to serialize a Model Object into the Django HttpResponse object from a dictionary for sending back to an ajax call...

Sometimes it's not obvious even with Django having the Debug enabled...the logs didn't say where it was.

Here's sample code:

I thought about putting a try/except around it, but there's got to be a better way.

Any thoughts?