-
-
Save domenkozar/1234549 to your computer and use it in GitHub Desktop.
Django Dozer runserver command.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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