Skip to content

Instantly share code, notes, and snippets.

@jeffkistler
Created June 1, 2011 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jeffkistler/1003267 to your computer and use it in GitHub Desktop.
Save jeffkistler/1003267 to your computer and use it in GitHub Desktop.
Django Dozer runserver command.
from django.core.management.commands.runserver import BaseRunserverCommand
from django.conf import settings
from dozer import Dozer
class Command(BaseRunserverCommand):
def get_handler(self, *args, **options):
"""
Returns the normal handler wrapped in a warm Dozer embrace.
"""
handler = super(Command, self).get_handler(*args, **options)
if settings.DEBUG:
handler = Dozer(handler)
return handler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment