<metaname="description" content="Find out about Python web frameworks, which are code libraries that solve common web application creation challenges.">
<divclass="well see-also">While you're learning about web frameworks you should also study <ahref="/deployment.html">web application deployment</a> and <ahref="/application-programming-interfaces.html">web APIs</a>.</div>
<h2>Do I have to use a web framework?</h2>
<p>Whether or not you use a web framework in your project depends on your
experience with web development and what you're trying to accomplish. If you
are a beginner programmer and just want to work on a web application as a
learning project then a framework can help you understand the concepts listed
above, such as URL routing, data manipulation and authentication that are
common to the majority of web applications.</p>
<p>On the other hand if you're an experienced programmer with significant
web development experience you may feel like the existing frameworks do not
match your project's requirements. In that case, you can mix and match
open source libraries such as <ahref="http://werkzeug.pocoo.org/">Werkzeug</a> for
WSGI plumbing with your own code to create your own framework. There's
still plenty of room in the Python ecosystem for new frameworks to satisfy
the needs of web developers that are unmet by <ahref="/django.html">Django</a>,
<ahref="/flask.html">Flask</a>, <ahref="/pyramid.html">Pyramid</a>, <ahref="/bottle.html">Bottle</a> and
<p>In short, whether or not you need to use a web framework to build a web
application depends on your experience and what you're trying to accomplish.
Using a web framework to build a web application certainly isn't required,
but it'll make most developers' lives easier in many cases.</p>
<h2>Web framework resources</h2>
<ul>
<li>
<p>"<ahref="http://www.jeffknupp.com/blog/2014/03/03/what-is-a-web-framework/">What is a web framework?</a>"
is an in-depth explanation of what web frameworks are and their relation
to web servers.</p>
</li>
<li>
<p>Check out the answer to the
"<ahref="http://stackoverflow.com/questions/4507506/what-is-a-web-framework-how-does-it-compare-with-lamp">What is a web framework and how does it compare to LAMP?</a>"
question on Stack Overflow.</p>
</li>
<li>
<p><ahref="http://youtu.be/W6KCPXl6Zuc">Frameworks</a> is a really well done short video
that explains how to choose between web frameworks. The author has some
particular opinions about what should be in a framework. For the most part
I agree although I've found sessions and database ORMs to be a helpful
part of a framework when done well.</p>
</li>
<li>
<p><ahref="https://www.airpair.com/python/posts/django-flask-pyramid">Django vs Flask vs Pyramid: Choosing a Python Web Framework</a>
contains background information and code comparisons for similar
web applications built in these three big Python frameworks.</p>
</li>
<li>
<p>This <ahref="http://www.konstruktor.ee/blog/python-web-framework-roundup/">Python web framework roundup</a>
covers Django, Flask and Bottle as well as several other lesser known Python
frameworks.</p>
</li>
<li>
<p>This fascinating blog post takes a look at the
<ahref="http://grokcode.com/864/snakefooding-python-code-for-complexity-visualization/">code complexity of several Python web frameworks</a>
by providing visualizations based on their code bases.</p>
</li>
<li>
<p><ahref="http://klen.github.io/py-frameworks-bench/">Python's web frameworks benchmarks</a>
is a test of the responsiveness of a framework with encoding an object to
JSON and returning it as a response as well as retrieving data from the
database and rendering it in a template. There were no conclusive results
but the output is fun to read about nonetheless.</p>
</li>
<li>
<p><ahref="http://www.reddit.com/r/webdev/comments/2les4x/what_frameworks_do_you_use_and_why_are_they/">What web frameworks do you use and why are they awesome?</a>
is a language agnostic Reddit discussion on web frameworks. It's interesting
to see what programmers in other languages like and dislike about their
suite of web frameworks compared to the main Python frameworks.</p>
</li>
<li>
<p>This user-voted question & answer site asked "<ahref="http://www.slant.co/topics/426/~what-are-the-best-general-purpose-python-web-frameworks-usable-in-production-sites">What are the best general purpose Python web frameworks usable in production?</a>".
The votes aren't as important as the list of the many frameworks
that are available to Python developers.</p>
</li>
</ul>
<h2>Web frameworks learning checklist</h2>
<ol>
<li>
<p>Choose a major Python web framework (<ahref="/django.html">Django</a> or
<ahref="/flask.html">Flask</a> are recommended) and stick with it. When you're just
starting it's best to learn one framework first instead of bouncing around
trying to understand every framework. </p>
</li>
<li>
<p>Work through a detailed tutorial found within the resources links on the
framework's page.</p>
</li>
<li>
<p>Study open source examples built with your framework of choice so you can
take parts of those projects and reuse the code in your application.</p>
</li>
<li>
<p>Build the first simple iteration of your web application then go to
the <ahref="/deployment.html">deployment</a> section to make it accessible on the
web.</p>
</li>
</ol>
<h3>Which web framework do you want to learn about?</h3>
<pstyle="font-size: .8em;">If you want to learn Python web development then
I highly recommend
<ahref="https://realpython.com/?utm_source=fsp&utm_medium=promo&utm_campaign=webframeworks" onclick="trackOutboundLink('https://realpython.com/?utm_source=fsp&utm_medium=promo&utm_campaign=webframeworks'); return false;">checking out Real Python</a>'s
<divstyle="padding: 0 0 20px 0; margin: 0 0 20px 0; background-color: #22B24C;">
<divclass="container">
<pclass="banner"><ahref="https://www.gumroad.com/l/python-deployments" style="color: #fff">Learning web development? Check out The Full Stack Python Guide to Deployments book</a>!</p>