Skip to content

Instantly share code, notes, and snippets.

@domenkozar
Forked from jeffkistler/dozer_server.py
Created September 22, 2011 11:06
Show Gist options
  • Save domenkozar/1234549 to your computer and use it in GitHub Desktop.
Save domenkozar/1234549 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 Profiler
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 = Profiler(handler)
return handler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment