Skip to content

Commit 6bc5f07

Browse files
committed
revamping flask page content
1 parent 4ebf3ec commit 6bc5f07

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

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

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,25 @@ than Django because Flask web application code is in most cases more explicit.
2121
Flask is easy to get started with as a beginner because there is little
2222
boilerplate code for getting a simple app up and running.
2323

24-
For example, here's a valid "hello world" web application with Flask (the
25-
equivalent in Django would be significantly more code):
24+
For example, here is a valid "Hello, world!" web application with Flask:
2625

27-
from flask import Flask
28-
app = Flask(__name__)
26+
```python
27+
from flask import Flask
28+
app = Flask(__name__)
2929

30-
@app.route('/')
31-
def hello_world():
32-
return 'Hello World!'
3330

34-
if __name__ == '__main__':
35-
app.run()
31+
@app.route('/')
32+
def hello_world():
33+
return 'Hello World!'
34+
35+
36+
if __name__ == '__main__':
37+
app.run()
38+
```
39+
40+
The equivalent "Hello, World!" web application using the [Django](/django.html)
41+
[web framework](/web-frameworks.html) would involve significantly more boilerplate
42+
code.
3643

3744
Flask was also written several years after Django and therefore
3845
learned from the Python community's reactions as the framework evolved.
@@ -66,9 +73,10 @@ Jökull Sólberg wrote a great piece articulating to this effect in his
6673
[#17 Deployment on Linux](http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xvii-deployment-on-linux-even-on-the-raspberry-pi)
6774
and
6875
[#18 Deployment on the Heroku Cloud](http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xviii-deployment-on-the-heroku-cloud).
69-
Miguel also wrote the
70-
[O'Reilly Flask Web Development](http://shop.oreilly.com/product/0636920031116.do)
71-
book which is also an excellent learning resource.
76+
Miguel also wrote and recorded numerous
77+
[Flask Web Development content including a great book and video](https://flaskbook.com/)
78+
book that are excellent resources worth the price, especially to support
79+
his continuous revisions to the content.
7280

7381
* If you're looking for a fun tutorial with Flask and WebSockets, check out
7482
my blog post on creating

0 commit comments

Comments
 (0)