Skip to content

Commit 8ad2fbe

Browse files
committed
more resources and explanation for django and flask
1 parent 0ec189a commit 8ad2fbe

File tree

6 files changed

+54
-11
lines changed

6 files changed

+54
-11
lines changed

change-log.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ <h1>Change Log</h1>
5252
<h2>2014</h2>
5353
<h3>May</h3>
5454
<ul>
55+
<li>Adding more logging resources.</li>
5556
<li>Continuing to add learning checklists to sections such as servers.</li>
5657
<li>Moving navigation options into meta tags on markdown pages.</li>
5758
</ul>

django.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ <h2>Why is Django a good web framework choice?</h2>
7878
<a href="http://www.meetup.com/djangoboston/">Django Boston</a> and
7979
<a href="http://www.meetup.com/The-San-Francisco-Django-Meetup-Group/">San Francisco Django</a>
8080
so new developers can get help when they are stuck.</p>
81+
<p>There's some debate on whether
82+
<a href="http://www.jeffknupp.com/blog/2012/12/11/learning-python-via-django-considered-harmful/">learning Python by using Django is a bad idea</a>.
83+
However, that criticism is invalid if you take the time to learn the Python
84+
syntax and language semantics first before diving into web development.</p>
8185
<h2>Django framework learning checklist</h2>
8286
<p><i class="fa fa-check-square-o"></i>
8387
<a href="https://docs.djangoproject.com/en/dev/topics/install/">Install Django</a> on

feeds/all.atom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<feed xmlns="http://www.w3.org/2005/Atom"><title>Matt Makai</title><link href="http://www.fullstackpython.com/" rel="alternate"></link><link href="http://www.fullstackpython.com/feeds/all.atom.xml" rel="self"></link><id>http://www.fullstackpython.com/</id><updated>2014-05-04T08:18:32Z</updated></feed>
2+
<feed xmlns="http://www.w3.org/2005/Atom"><title>Matt Makai</title><link href="http://www.fullstackpython.com/" rel="alternate"></link><link href="http://www.fullstackpython.com/feeds/all.atom.xml" rel="self"></link><id>http://www.fullstackpython.com/</id><updated>2014-05-05T07:14:54Z</updated></feed>

flask.html

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,29 @@
4545
<div class="row">
4646
<div class="col-md-8">
4747
<h1>Flask</h1>
48-
<p><a href="http://flask.pocoo.org/">Flask</a> is a Python microframework deliberately
49-
built with a
50-
<a href="http://flask.pocoo.org/docs/design/">small core and easy-to-extend philosophy</a>.
51-
Flask is generally considered more
48+
<p><a href="http://flask.pocoo.org/">Flask</a> is a Python web framework built with a
49+
<a href="http://flask.pocoo.org/docs/design/">small core and easy-to-extend philosophy</a>. </p>
50+
<h2>Why is Flask a good web framework choice?</h2>
51+
<p>Flask is generally considered more
5252
<a href="http://stackoverflow.com/questions/58968/what-defines-pythonian-or-pythonic">Pythonic</a>
53-
than Django because Flask web application code is often more
54-
explicit. Flask was also written several years after Django and therefore
53+
than Django because Flask web application code is by and large more explicit.
54+
Flask is easy to get started with as a beginner because there is little
55+
boilerplate code for getting a simple app up and running. </p>
56+
<p>For example, here's a valid "hello world" web application with Flask (the
57+
equivalent in Django would be significantly more code):</p>
58+
<div class="codehilite"><pre><span class="n">from</span> <span class="n">flask</span> <span class="n">import</span> <span class="n">Flask</span>
59+
<span class="n">app</span> <span class="o">=</span> <span class="n">Flask</span><span class="p">(</span><span class="n">__name__</span><span class="p">)</span>
60+
61+
<span class="err">@</span><span class="n">app</span><span class="p">.</span><span class="n">route</span><span class="p">(</span><span class="sc">&#39;/&#39;</span><span class="p">)</span>
62+
<span class="n">def</span> <span class="n">hello_world</span><span class="p">()</span><span class="o">:</span>
63+
<span class="k">return</span> <span class="err">&#39;</span><span class="n">Hello</span> <span class="n">World</span><span class="o">!</span><span class="err">&#39;</span>
64+
65+
<span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="err">&#39;</span><span class="n">__main__</span><span class="err">&#39;</span><span class="o">:</span>
66+
<span class="n">app</span><span class="p">.</span><span class="n">run</span><span class="p">()</span>
67+
</pre></div>
68+
69+
70+
<p>Flask was also written several years after Django and therefore
5571
learned from the Python community's reactions as the framework evolved.
5672
Jökull Sólberg wrote a great piece articulating to this effect in his
5773
<a href="http://jokull.calepin.co/my-flask-to-django-experience.html">experience switching between Flask and Django</a>.</p>

source/content/pages/02-web-frameworks/0203-django.markdown

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ groups such as [Django District](http://www.meetup.com/django-district/),
5656
[San Francisco Django](http://www.meetup.com/The-San-Francisco-Django-Meetup-Group/)
5757
so new developers can get help when they are stuck.
5858

59+
There's some debate on whether
60+
[learning Python by using Django is a bad idea](http://www.jeffknupp.com/blog/2012/12/11/learning-python-via-django-considered-harmful/).
61+
However, that criticism is invalid if you take the time to learn the Python
62+
syntax and language semantics first before diving into web development.
63+
5964

6065
## Django framework learning checklist
6166
<i class="fa fa-check-square-o"></i>

source/content/pages/02-web-frameworks/0205-flask.markdown

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,30 @@ choice4text: How can I version and store my source code so I don't lose it?
1717

1818

1919
# Flask
20-
[Flask](http://flask.pocoo.org/) is a Python microframework deliberately
21-
built with a
20+
[Flask](http://flask.pocoo.org/) is a Python web framework built with a
2221
[small core and easy-to-extend philosophy](http://flask.pocoo.org/docs/design/).
22+
23+
## Why is Flask a good web framework choice?
2324
Flask is generally considered more
2425
[Pythonic](http://stackoverflow.com/questions/58968/what-defines-pythonian-or-pythonic)
25-
than Django because Flask web application code is often more
26-
explicit. Flask was also written several years after Django and therefore
26+
than Django because Flask web application code is by and large more explicit.
27+
Flask is easy to get started with as a beginner because there is little
28+
boilerplate code for getting a simple app up and running.
29+
30+
For example, here's a valid "hello world" web application with Flask (the
31+
equivalent in Django would be significantly more code):
32+
33+
from flask import Flask
34+
app = Flask(__name__)
35+
36+
@app.route('/')
37+
def hello_world():
38+
return 'Hello World!'
39+
40+
if __name__ == '__main__':
41+
app.run()
42+
43+
Flask was also written several years after Django and therefore
2744
learned from the Python community's reactions as the framework evolved.
2845
Jökull Sólberg wrote a great piece articulating to this effect in his
2946
[experience switching between Flask and Django](http://jokull.calepin.co/my-flask-to-django-experience.html).

0 commit comments

Comments
 (0)