djangodotcloudwerkzeug

How to use werkzeug debugger in dotcloud?


I am trying to find some way to set a breakpoint while running a Django server in dotcloud.

I found the following hopeful sounding link http://docs.dotcloud.com/tutorials/python/django/#advanced-debugging-with-werkzeug.

When I searched the web page however I could not find any reference to the debugger.

Is this function still available in dotcloud? If not is there another good option?


Solution

  • Some things to think about before enabling the werkzeug debugger:

    Here's what you can do to set it up:

    1) add the following to your wsgi.py

    # The following lines enable the werkzeug debugger
    import django.views.debug
    
    def null_technical_500_response(request, exc_type, exc_value, tb):
        raise exc_type, exc_value, tb
    django.views.debug.technical_500_response = null_technical_500_response
    from werkzeug.debug import DebuggedApplication
    application = DebuggedApplication(application, evalex=True)
    

    2) add the following to your requirements.txt

    werkzeug
    

    If you'd like to try out a quick sample of the debugger, I've setup example of the interactive debugger. This test app will only be available for a few days. http://django-johndotcloud.dotcloud.com/raise/

    References: