You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
than Django because Flask web application code is in most cases more explicit.
21
-
Flask is easy to get started with as a beginner because there is little
22
-
boilerplate code for getting a simple app up and running.
21
+
than the [Django](/django.html) web framework because in common situations the
22
+
equivalent Flask web application is more explicit. Flask is also easy to get
23
+
started with as a beginner because there is little boilerplate code for getting a
24
+
simple app up and running.
23
25
24
26
For example, here is a valid "Hello, world!" web application with Flask:
25
27
@@ -30,13 +32,15 @@ app = Flask(__name__)
30
32
31
33
@app.route('/')
32
34
defhello_world():
33
-
return'Hello World!'
34
-
35
+
return'Hello, World!'
35
36
36
37
if__name__=='__main__':
37
38
app.run()
38
39
```
39
40
41
+
The above code shows "Hello, World!" on localhost port 5000 in a web browser
42
+
when run with the `python app.py` command and the Flask library installed.
43
+
40
44
The equivalent "Hello, World!" web application using the [Django](/django.html)
41
45
[web framework](/web-frameworks.html) would involve significantly more boilerplate
42
46
code.
@@ -78,29 +82,11 @@ Jökull Sólberg wrote a great piece articulating to this effect in his
78
82
book that are excellent resources worth the price, especially to support
79
83
his continuous revisions to the content.
80
84
81
-
* If you're looking for a fun tutorial with Flask and WebSockets, check out
82
-
my blog post on creating
83
-
[Choose Your Own Adventure Presentations with Reveal.js, Python and WebSockets](https://www.twilio.com/blog/2014/11/choose-your-own-adventure-presentations-with-reveal-js-python-and-websockets.html).
84
-
Follow up that tutorial by
85
-
[building an admin interface in part 1](https://www.twilio.com/blog/2015/03/choose-your-own-adventures-presentations-wizard-mode-part-1-of-3.html),
[tags for each step](https://github.com/mattmakai/choose-your-own-adventure-presentations/releases)
93
-
in the blog posts.
94
-
95
85
*[Microservices with Flask, Docker, and React](https://testdriven.io/)
96
86
teaches how to spin up a reproducible Flask development environment with
97
87
[Docker](/docker.html). It shows how to deploy it to an Amazon EC2 instance
98
88
then scale the services on Amazon EC2 Container Service (ECS).
99
89
100
-
* This [simple Flask app uses Twilio Voice](https://www.twilio.com/blog/2015/09/warm-phone-call-transfers-with-python-flask-and-twilio-voice.html)
101
-
to do voice calling with three participants. It's a fun introduction
102
-
to Python and Flask I wrote for the Twilio blog.
103
-
104
90
*[The Flask Extensions Registry](http://flask.pocoo.org/extensions/) is a
105
91
curated list of the best packages that extend Flask. It's the first location
106
92
to look through when you're wondering how to do something that's not in the
@@ -155,9 +141,20 @@ Jökull Sólberg wrote a great piece articulating to this effect in his
155
141
[blueprints](http://flask.pocoo.org/docs/0.10/blueprints/) for large
156
142
projects.
157
143
158
-
*[Video streaming with Flask](http://blog.miguelgrinberg.com/post/video-streaming-with-flask)
159
-
is another fantastic tutorial by Miguel Grinberg that covers video
160
-
streaming.
144
+
* If you're looking for a fun tutorial with Flask and WebSockets, check out
145
+
my blog post on creating
146
+
[Choose Your Own Adventure Presentations with Reveal.js, Python and WebSockets](https://www.twilio.com/blog/2014/11/choose-your-own-adventure-presentations-with-reveal-js-python-and-websockets.html).
147
+
Follow up that tutorial by
148
+
[building an admin interface in part 1](https://www.twilio.com/blog/2015/03/choose-your-own-adventures-presentations-wizard-mode-part-1-of-3.html),
[tags for each step](https://github.com/mattmakai/choose-your-own-adventure-presentations/releases)
156
+
in the blog posts.
157
+
161
158
162
159
*[One line of code cut our Flask page load times by 60%](https://medium.com/@5hreyans/the-one-weird-trick-that-cut-our-flask-page-load-time-by-70-87145335f679)
163
160
is an important note about optimizing Flask template cache size to
@@ -185,7 +182,7 @@ Jökull Sólberg wrote a great piece articulating to this effect in his
185
182
static website from a backend data source.
186
183
187
184
188
-
## Open source Flask example projects
185
+
###Open source Flask example projects
189
186
*[Choose Your Own Adventure Presentations](https://github.com/mattmakai/choose-your-own-adventure-presentations)
190
187
combines Flask with [Reveal.js](http://lab.hakim.se/reveal-js/) and text
191
188
messages to create presentations where the audience can vote on how the
@@ -220,7 +217,7 @@ Jökull Sólberg wrote a great piece articulating to this effect in his
220
217
psutils to display information about the computer it is running on.
0 commit comments