otxfrg
Last Updated: February 25, 2016
·
693
· jay-johnson
006a614ac35cb9de3dcd7206ac5e1b7a

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:
https://github.com/FlowStacks/email-voting/blob/master/stacks_site/apps/back_end/api_methods.py#L445

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

Any thoughts?

Say Thanks
Respond