Hacker News new | ask | show | jobs
by squeaky-clean 1652 days ago
I usually have a FBV handler (foo_handler) that just passes along all the required parameters to foo_get, foo_post, etc, and then takes the return value of those and wraps it in a HttpResponse/JsonResponse.

That way my actual view logic doesn't have to deal with anything http, and it makes testing them way simpler.