Skip to content

Commit 7d3e5fa

Browse files
committed
slew of flask page updates from last night
1 parent a12fded commit 7d3e5fa

File tree

5 files changed

+71
-40
lines changed

5 files changed

+71
-40
lines changed

content/pages/04-web-development/00-web-development.markdown

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,22 @@ many other topics. The following resources provide a range of perspectives
4848
and when combined together should get you oriented in the web development
4949
world.
5050

51+
* If you want to be a web developer it's important to know the foundational
52+
tools used to build websites and web applications. It is also important to
53+
understand that the core concepts such as
54+
HTTP, URLs and [HTML](/hypertext-markup-language-html.html) were all there
55+
at the beginning and then were expanded with new specifications over time.
56+
This article on the
57+
[History of the Web](https://webfoundation.org/about/vision/history-of-the-web/)
58+
succinctly explains the origins of the web starting from Tim Berners-Lee's
59+
origin vision and release at CERN.
60+
61+
* The [Evolution of the Web](http://www.evolutionoftheweb.com/) visualizes
62+
how web browsers and related technologies have changed over time as well as
63+
the overall growth of the Internet in the amount of data transferred. Note
64+
that the visualization unfortunately stops around the beginning of 2013 but
65+
it's a good way to explore what happened in the first 24 years.
66+
5167
* [Web application development is different and better](http://radar.oreilly.com/2014/01/web-application-development-is-different-and-better.html)
5268
provides some context for how web development has evolved from writing
5369
static HTML files into the complex JavaScript client-side applications
@@ -75,12 +91,6 @@ world.
7591
for beginners and intermediate web users who want to build websites.
7692
It's worth a look for general web development learning.
7793

78-
* The [Evolution of the Web](http://www.evolutionoftheweb.com/) visualizes
79-
how web browsers and related technologies have changed over time as well as
80-
the overall growth of the Internet in the amount of data transferred. Note
81-
that the visualization unfortunately stops around the beginning of 2013 but
82-
it's a good way to explore what happened in the first 24 years.
83-
8494
* Web development involves HTTP communication between the server, hosting
8595
a website or web application, and the client, a web browser. Knowing
8696
how web browsers works is important as a developer, so take a look at

content/pages/04-web-development/01-web-frameworks.markdown

Lines changed: 41 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,16 @@ meta: Find out about Python web frameworks, which are code libraries that solve
88

99

1010
# Web frameworks
11-
A web framework is a code library that makes a developer's life easier when
12-
building reliable, scalable and maintainable web applications.
11+
A web framework is a code library that makes
12+
[web development](/web-development.html) faster and easier by providing
13+
common patterns for building reliable, scalable and maintainable web
14+
applications. After the early 2000s, professional web development projects
15+
always use an existing web framework except in very unusual situations.
1316

17+
<img src="/img/visuals/web-frameworks.jpg" width="100%" alt="Django, Bottle, Flask, Pyramid, Falcon and Sanic logos, copyright their respective owners." class="shot rnd outl">
1418

15-
## Why are web frameworks useful?
19+
20+
### Why are web frameworks useful?
1621
Web frameworks encapsulate what developers have learned over the past twenty
1722
years while programming sites and applications for the web. Frameworks make
1823
it easier to reuse code for common HTTP operations and to structure projects
@@ -22,16 +27,21 @@ maintain the application.
2227
<div class="well see-also">Web frameworks are a concept implemented by <a href="/django.html">Django</a>, <a href="/flask.html">Flask</a>, <a href="/bottle.html">Bottle</a>, <a href="/pyramid.html">Pyramid</a>, <a href="/morepath.html">Morepath</a> and <a href="/other-web-frameworks.html">several other libraries</a>. Learn how the parts fit together in the <a href="/web-development.html">web development</a> chapter or view <a href="/table-of-contents.html">all topics</a>.</div>
2328

2429

25-
## Common web framework functionality
30+
### Common web framework functionality
2631
Frameworks provide functionality in their code or through extensions to
2732
perform common operations required to run web applications. These common
2833
operations include:
2934

3035
1. URL routing
31-
2. HTML, XML, JSON, and other output format templating
32-
3. Database manipulation
33-
4. Security against Cross-site request forgery (CSRF) and other attacks
34-
5. Session storage and retrieval
36+
1. Input form handling and validation
37+
1. [HTML](/hypertext-markup-language-html.html), XML, JSON, and other output
38+
formats with a [templating engine](/template-engines.html)
39+
1. Database connection configuration and persistent data manipulation through
40+
an [object-relational mapper (ORM)](/object-relational-mappers-orms.html)
41+
1. [Web security](/web-application-security.html) against
42+
Cross-site request forgery (CSRF), SQL Injection,
43+
Cross-site Scripting (XSS) and other common malicious attacks
44+
1. Session storage and retrieval
3545

3646
Not all web frameworks include code for all of the above functionality.
3747
Frameworks fall on the spectrum from executing a single use case to providing
@@ -40,11 +50,13 @@ the "batteries-included" approach where everything possible comes bundled
4050
with the framework while others have a minimal core package that is amenable
4151
to extensions provided by other packages.
4252

43-
For example, the [Django web application framework](/django.html) includes an
44-
Object-Relational Mapping (ORM) layer that abstracts relational database
45-
read, write, query, and delete operations. However, Django's ORM
46-
cannot work without significant modification on non-relational databases
47-
such as [MongoDB](http://www.mongodb.org/).
53+
For example, the [Django web application framework](/django.html) includes
54+
[the Django ORM](/django-orm.html) layer that allows a deveoper to write
55+
[relational database](/databases.html)
56+
read, write, query, and delete operations in Python code rather than SQL.
57+
However, Django's ORM cannot work without significant modification on
58+
[non-relational (NoSQL) databases](/no-sql-datastore.html) such as
59+
[MongoDB](/mongodb.html) or [Cassandra](/cassandra.html).
4860

4961
Some other web frameworks such as [Flask](/flask.html) and
5062
[Pyramid](/pyramid.html) are easier to
@@ -53,23 +65,8 @@ There is a spectrum between minimal functionality with easy extensibility on
5365
one end and including everything in the framework with tight integration on
5466
the other end.
5567

56-
## Comparing web frameworks
57-
Are you curious about how the code in a Django project is structured compared
58-
with Flask? Check out
59-
[this Django web application tutorial](https://www.twilio.com/docs/howto/walkthrough/appointment-reminders/python/django)
60-
and then view [the same application built with Flask](https://www.twilio.com/docs/howto/walkthrough/appointment-reminders/python/flask).
61-
62-
There is also a repository called
63-
[compare-python-web-frameworks](https://github.com/mattmakai/compare-python-web-frameworks)
64-
where the same web application is being coded with varying Python web
65-
frameworks, templating engines and
66-
[object-relational mappers](/object-relational-mappers-orms.html).
67-
68-
69-
<div class="well see-also">While you're learning about web frameworks you should also study <a href="/deployment.html">web application deployment</a> and <a href="/application-programming-interfaces.html">web APIs</a>.</div>
70-
7168

72-
## Do I have to use a web framework?
69+
### Do I have to use a web framework?
7370
Whether or not you use a web framework in your project depends on your
7471
experience with web development and what you're trying to accomplish. If you
7572
are a beginner programmer and just want to work on a web application as a
@@ -93,7 +90,20 @@ Using a web framework to build a web application certainly isn't required,
9390
but it'll make most developers' lives easier in many cases.
9491

9592

96-
## Web framework resources
93+
### Comparing web frameworks
94+
Are you curious about how the code in a Django project is structured compared
95+
with Flask? Check out
96+
[this Django web application tutorial](https://www.twilio.com/docs/sms/tutorials/appointment-reminders-python-django)
97+
and then view [the same application built with Flask](https://www.twilio.com/docs/sms/tutorials/appointment-reminders-python-flask).
98+
99+
There is also a repository called
100+
[compare-python-web-frameworks](https://github.com/mattmakai/compare-python-web-frameworks)
101+
where the same web application is being coded with varying Python web
102+
frameworks, templating engines and
103+
[object-relational mappers](/object-relational-mappers-orms.html).
104+
105+
106+
### Web framework resources
97107
* When you are learning how to use one or more web frameworks it's helpful
98108
to have an idea of what the code under the covers is doing. This post on
99109
building a
@@ -142,8 +152,7 @@ but it'll make most developers' lives easier in many cases.
142152
that are available to Python developers.
143153

144154

145-
146-
## Web frameworks learning checklist
155+
### Web frameworks learning checklist
147156
1. Choose a major Python web framework ([Django](/django.html) or
148157
[Flask](/flask.html) are recommended) and stick with it. When you're just
149158
starting it's best to learn one framework first instead of bouncing around

content/pages/04-web-development/03-flask.markdown

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ extensive functionality. The following tutorials will guide you through
153153
more advanced topics and provide solid learning materials, especially when
154154
combined with the example real-world projects listed in the next section.
155155

156+
* [Visualize your trip with Flask and Mapbox](http://kazuar.github.io/visualize-trip-with-flask-and-mapbox/)
157+
along with the
158+
[open source flask_mapbox GitHub repository](https://github.com/kazuar/flask_mapbox)
159+
provides a fantastic example visualization of a trip to Iceland with
160+
Flask as the backend web framework.
161+
156162
* [Microservices with Flask, Docker, and React](https://testdriven.io/)
157163
teaches how to spin up a reproducible Flask development environment with
158164
[Docker](/docker.html). It shows how to [deploy](/deployment.html) it to an
@@ -201,6 +207,12 @@ combined with the example real-world projects listed in the next section.
201207
with
202208
[standalone WSGI containers](http://flask.pocoo.org/docs/deploying/wsgi-standalone/).
203209

210+
* [How to use Flask to upload files to Amazon S3](http://zabana.me/notes/upload-files-amazon-s3-flask.html)
211+
provides all the code with detailed explanations on how to store files
212+
using [boto](https://boto3.readthedocs.io/en/latest/) and
213+
[Amazon Web Services' S3](https://aws.amazon.com/s3/) with a Flask
214+
application.
215+
204216
* [Handling Email Confirmation in Flask](https://realpython.com/blog/python/handling-email-confirmation-in-flask/)
205217
is a great walkthrough for a common use case of ensuring an email address
206218
matches with the user's login information.

content/pages/meta/04-page-statuses.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ kept up to date with accurate descriptions and resources.
109109
|Page | Status |
110110
|-----------------------------------------------------------|--------------|
111111
|[Web development](/web-development.html) | starter |
112-
|[Web frameworks](/web-frameworks.html) | intermediate |
112+
|[Web frameworks](/web-frameworks.html) | maintain |
113113
|[Django](/django.html) | intermediate |
114-
|[Flask](/flask.html) | intermediate |
114+
|[Flask](/flask.html) | maintain |
115115
|[Bottle](/bottle.html) | intermediate |
116116
|[Pyramid](/pyramid.html) | starter |
117117
|[Falcon](/falcon.html) | starter |
36.3 KB
Loading

0 commit comments

Comments
 (0)