<metaname="description" content="Full Stack Python explains each layer of the web application stack, from the server up through the rendering in a user's browser.">
<p>A web application framework is a code library that makes a developer's life
easier when building reliable, scalable and maintainable web applications.</p>
<h2>Why are web frameworks necessary?</h2>
<p>Web frameworks encapsulate what developers have learned over the past twenty
years while building dynamic web applications. Frameworks make it easier
to reuse code for common HTTP operations and to structure your code so that
it is maintainable.</p>
<h2>Common web framework functionality</h2>
<p>Frameworks provide functionality in their code or through extensions to
perform common operations required to run web applications. These common
operations include:</p>
<ol>
<li>URL routing</li>
<li>HTML, XML, JSON, and other output format templating</li>
<li>Database manipulation</li>
<li>Security against Cross-site request forgery (CSRF) and other attacks</li>
</ol>
<p>Not all web frameworks include code for all of the above
functionality. Frameworks fall somewhere between simply executing a
single use case and attempting to be everything to every developer with
increased complexity. Some frameworks take the "batteries-included" approach
where everything possible comes bundled with the framework while others
have a minimal code library that plays well with extensions.</p>
<p>For example, the Django web application framework includes an
Object-Relational Mapping (ORM) layer that abstracts relational database
read, write, query, and delete operations. However, Django's ORM
cannot work without significant modification on non-relational databases such as
<ahref="http://www.mongodb.org/">MongoDB</a>.
Some other web frameworks such as Flask and Pyramid are easier to
use with non-relational databases by incorporating external Python libraries.
There is a spectrum between minimal functionality with easy extensibility and
including everything in the framework with tight integration.</p>
<h2>General 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>"
by <ahref="https://twitter.com/jeffknupp">Jeff Knupp</a>
is an in-depth explanation of what a web framework is 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="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>
</ul>
<h2>Web frameworks learning checklist</h2>
<p><iclass="fa fa-check-square-o"></i>
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>
<p><iclass="fa fa-check-square-o"></i>
Work through a detailed tutorial found within the resources links on the
framework's page.</p>
<p><iclass="fa fa-check-square-o"></i>
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>
<p><iclass="fa fa-check-square-o"></i>
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>
<h3>Which web framework do you want to learn about?</h3>
<h4>Interested in a complete Full Stack Python book with detailed tutorials and example code? Sign up here and you'll get an alert email if a book is created. No other emails will be sent other than sign up confirmation.</h4>
$("#mc-embedded-subscribe-form").unbind('submit');//remove the validator so we can get into beforeSubmit on the ajaxform, which then calls the validator