“Sometimes web applications need small and fast components that are best written in C.
Example: ad banner rotation engine. It gets invoked many times on every page of your site producing little HTML snippets based on predefined configuration. How would you implement it?
CGI is not an option as it gets loaded and unloaded on every request. Writing a module for your main web server such as Apache httpd or nginx gives best performance but server’s API isn’t very friendly (especially when dealing with shared memory, etc.). What we need is sort of servlet container for C (just like Java has).
Before writing NXWEB I evaluated a number of existing light/embeddable web servers (mongoose, microhttpd, libevent, G-WAN) each one having their own drawbacks (see notes to benchmarks)…”
“Flask is a micro web framework powered by Python. Its API is fairly small, making it easy to learn and simple to use. But don’t let this fool you, as it’s powerful enough to support enterprise-level applications handling large amounts of traffic. You can start small with an app contained entirely in one file, then slowly scale up to multiple files and folders in a well-structured manner as your site becomes more and more complex…”
“Scaling a Flask application is no immediately obvious matter. At plug.dj we had ~22,000 line Flask application. At my previous employer our Flask application was significantly larger. Ultimately scaling a code-base is less about the framework used and more about the software design experience of the developers working on it. Scaling in terms concurrent users also has little to do with the web framework and more to do with your understanding of load-balancing, caching, databases, etc. That being said, what have I learned about how to organize a Flask application to comfortably grow?…”
OAuth is a pain. Flask-Dance makes it better. Learn how the Flask-Dance library was created, and why it makes it easier to use OAuth-enabled APIs like Facebook, Twitter, Google, GitHub, and a lot more.
“In my years of programming in Python and roaming around GitHub’s Explore section, I’ve come across a few libraries that stood out to me as being particularly enjoyable to use. This blog post is an effort to further disseminate that knowledge.
Please note that I’ve specifically excluded libraries like sqlalchemy and Flask that are too obviously awesome to make the list…”
“This talk shows some interesting patterns for large scale Flask applications and how Flask extension should be structured. It also dives into some of the more unknown helpers in the Werkzeug and Jinja2 base libraries. The goal of this talk is to share some of the things that the documentation can’t explain well by itself. Required prerequisites: basic knowledge of how Flask operates…”
“This is the first post in a series dedicated to building websites with Python and more notably Flask. In this post, I will talk about setting up Flask with a database, using configuration environments, managing assets and deploying the app to production…”