Tag Archives: debug

Dubugging Flask applications under uWSGI

Flask comes with a fantastic debug mode available with the built-in server, but is advertised as unusable under uWSGI, due to some forking limitations, which I couldn’t understand. There is a way that allows you to spawn the development debug mode in Flask (and Werkzeug) regardless of what everyone around seems to say.

Before the if __name__ == '__main__': part of your application, i.e. at the very end, you have to wrap a werkzeug.debug.DebuggedApplication middleware around your app object.

if ( app.debug ):
    from werkzeug.debug import DebuggedApplication
    app.wsgi_app = DebuggedApplication( app.wsgi_app, True )

That’s it. Simple as that! Debug your Flask application from the browser, without using the built-in development server. Don’t forget to switch off debugging in production, as the console offers arbitrary code execution.

For everything else there’s Winpdb.



Rewrite rules and permalink issues dump

WordPress 404 Permalink Rewrite Problems

Produce a raw dump of some of the core parts that should help shed some light on issues regarding WordPress rewrite rules, permalinks and missing template files when a 404 is encountered. Fork, improve, comment. This is for environments with no fancy IDEs, Xdebug, debug plugins.

Continue reading



Command Line Android Development: Debugging

Continuing into Command Line Android Development (last week I did a piece on Command Line Android Development: Basics), today I’d like to go over some of the techniques that allow for debugging applications from the command line.

Command Line Android Application Debugging

I personally have a distaste towards IDEs, preferring lightweight solutions, with maybe less convenience. I addition to saving resources and having direct control over what happens and what doesn’t, I find that by doing things the low level way you begin to better understand how things work.

Sure, Eclipse will let you debug in 2 clicks, but what do you learn besides that you application has a bug? There should always be time to learn a thing or two about the underlying technologies. What if one day, you have to SSH into a server and debug a Java application right there and then? If you’ve never seen anything beyond Eclipse in your life you’re in for some hair pulling. So let’s learn some low level stuff.

Continue reading