Use DjangoJSONEncoder for encoding form submission

Fixes #798