forked from mattmakai/fullstackpython.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathall.html
5000 lines (4984 loc) · 253 KB
/
all.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Matt Makai">
<meta name="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.">
<link rel="shortcut icon" href="theme/img/fsp-fav.png">
<title>Full Stack Python</title>
<link href="theme/css/fsp.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
<link href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.css" rel="stylesheet">
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-19910497-7']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script> </head>
<body>
<a href="https://github.com/makaimc/fullstackpython.github.com" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="logo-header-section">
<a href="/" style="text-decoration: none; border: none;"><img src="theme/img/fsp-logo.png" height="52" width="52" class="logo-image" style="padding-top: 1px;"/></a>
<span class="logo-title"><a href="/">Full Stack Python</a></span>
</div>
</div>
</div> <div class="row">
<div class="col-md-8">
<h1>Introduction</h1>
<p>You're knee deep in learning the <a href="http://www.python.org/">Python</a>
programming language. The syntax is starting to make sense. The first
few "<em>ahh-ha</em>!" moments are hitting you as you're learning conditional
statements, for loops and classes while playing around with the open source
libraries that make Python such an amazing language.</p>
<p>Now you want to take your initial Python knowledge and make something real.
A real web application that's available on the web which you can show off or
sell as a service to other people. That's where Full Stack Python comes in.
You've come to the right place to learn everything you need to deploy and
run a production Python web application.</p>
<p>This guide branches out on topic because your learning needs depend on what
you're currently trying to do. </p>
<h3>Let's get started. What do you need to do right now?</h3>
<h1>Web frameworks</h1>
<p>A web 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 programming sites and applications for the web. Frameworks make
it easier to reuse code for common HTTP operations and to structure projects
so developers with knowledge of the framework can more quickly build and
maintain the application.</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
<a href="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>"<a href="http://www.jeffknupp.com/blog/2014/03/03/what-is-a-web-framework/">What is a web framework?</a>"
by <a href="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
"<a href="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><a href="http://youtu.be/W6KCPXl6Zuc">Frameworks</a> is a really well done short video
that explains how to choose between web frameworks. The author has some
particular opinions about what should be in a framework. For the most part
I agree although I've found sessions and database ORMs to be a helpful
part of a framework when done well.</p>
</li>
<li>
<p><a href="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 <a href="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
<a href="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>
<li>
<p><a href="http://www.reddit.com/r/webdev/comments/2les4x/what_frameworks_do_you_use_and_why_are_they/">What web frameworks do you use and why are they awesome?</a>
is a language agnostic Reddit discussion on web frameworks. It's interesting
to see what programmers in other languages like and dislike about their
suite of web frameworks compared to the main Python frameworks.</p>
</li>
</ul>
<h2>Web frameworks learning checklist</h2>
<p><i class="fa fa-check-square-o"></i>
Choose a major Python web framework (<a href="/django.html">Django</a> or
<a href="/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><i class="fa fa-check-square-o"></i>
Work through a detailed tutorial found within the resources links on the
framework's page.</p>
<p><i class="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><i class="fa fa-check-square-o"></i>
Build the first simple iteration of your web application then go to
the <a href="/deployment.html">deployment</a> section to make it accessible on the
web.</p>
<h3>Which web framework do you want to learn about?</h3>
<h1>Django</h1>
<p><a href="http://www.djangoproject.com/">Django</a> is a widely used Python web
application framework with a "batteries-included" philosophy. The principle
behind batteries-included is that the common functionality for building
web applications should come with the framework instead of as separate
libraries. </p>
<p><a href="http://www.djangoproject.com/" style="border: none;"><img src="theme/img/django-logo-positive.png" width="100%" alt="Official Django logo. Trademark Django Software Foundation." class="technical-diagram" /></a></p>
<p>For example,
<a href="https://docs.djangoproject.com/en/dev/topics/auth/">authentication</a>,
<a href="https://docs.djangoproject.com/en/dev/topics/http/urls/">URL routing</a>, a
<a href="https://docs.djangoproject.com/en/dev/topics/templates/">templating system</a>,
an <a href="https://docs.djangoproject.com/en/dev/topics/db/">object-relational mapper</a>,
and <a href="https://docs.djangoproject.com/en/dev/topics/migrations/">database schema migrations</a>
(as of version 1.7) are all included with the <a href="https://pypi.python.org/pypi/Django/">Django framework</a>.
Compare that included functionality to the Flask framework which requires a
separate library such as
<a href="https://flask-login.readthedocs.org/en/latest/">Flask-Login</a>
to perform user authentication. </p>
<p>The batteries-included and extensibility philosophies are simply two different
ways to tackle framework building. Neither philosophy is inherently better
than the other.</p>
<h2>Why is Django a good web framework choice?</h2>
<p>The Django project's stability, performance and community have grown
tremendously over the past decade since the framework's creation. Detailed
tutorials and best practices are readily available on the web and in books.
The framework continues to add significant new functionality such as
<a href="https://docs.djangoproject.com/en/dev/topics/migrations/">database migrations</a>
with each release. </p>
<p>I highly recommend the Django framework as a starting place for new Python web
developers because the official documentation and tutorials are some of the
best anywhere in software development. Many cities also have Django-specific
groups such as <a href="http://www.meetup.com/django-district/">Django District</a>,
<a href="http://www.meetup.com/djangoboston/">Django Boston</a> and
<a href="http://www.meetup.com/The-San-Francisco-Django-Meetup-Group/">San Francisco Django</a>
so new developers can get help when they are stuck.</p>
<p>There's some debate on whether
<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>.
However, that criticism is invalid if you take the time to learn the Python
syntax and language semantics first before diving into web development.</p>
<h2>Django tutorials</h2>
<ul>
<li>
<p><a href="http://www.tangowithdjango.com/book/">Tango with Django</a> is an extensive
set of free introductions to using the most popular Python web framework. Several
current developers said this book really helped them get over the initial
framework learning curve.</p>
</li>
<li>
<p><a href="http://twoscoopspress.com/products/two-scoops-of-django-1-6">2 Scoops of Django</a>
by Daniel Greenfeld and Audrey Roy is well worth the price of admission if
you're serious about learning how to correctly develop Django websites.</p>
</li>
<li>
<p><a href="http://effectivedjango.com/">Effective Django</a> is another free introduction
to the web framework.</p>
</li>
<li>
<p><a href="http://www.obeythetestinggoat.com/">Test-Driven Development with Python</a>
focuses on web development using Django and JavaScript. This book uses
the development of a website using the Django web framework as a real
world example of how to perform test-driven development (TDD). There is
also coverage of NoSQL, websockets and asynchronous responses. The book can
be read online for free or purchased in hard copy via O'Reilly.</p>
</li>
<li>
<p>The <a href="http://www.reddit.com/r/django">Django subreddit</a> often has links to
the latest resources for learning Django and is also a good spot to ask
questions about it.</p>
</li>
<li>
<p>Lincoln Loop wrote a
<a href="http://lincolnloop.com/django-best-practices/">Django Best Practices guide</a>
for the community.</p>
</li>
<li>
<p>Steve Losh wrote an incredibly detailed <a href="http://stevelosh.com/blog/2011/06/django-advice/">Django Advice guide</a>.</p>
</li>
<li>
<p><a href="http://programming.oreilly.com/2014/04/simplifying-django.html">Lightweight Django</a>
has several nice examples for breaking Django into smaller simplier
components.</p>
</li>
<li>
<p>The <a href="https://github.com/rogueleaderr/definitive_guide_to_django_deployment">Definitive Guide to Django Deployment</a>
explains the architecture of the resulting set up and includes Chef scripts
to automate the deployment.</p>
</li>
<li>
<p><a href="http://agiliq.com/blog/2014/08/deploying-a-django-app-on-amazon-ec2-instance/">Deploying a Django app on Amazon EC2 instance</a>
is a detailed walkthrough for deploying an example Django app to Amazon
Web Services.</p>
</li>
<li>
<p>This <a href="http://aliteralmind.wordpress.com/2014/09/21/jquery_django_tutorial/">step-by-step guide for Django</a>
shows how to transmit data via AJAX with JQuery.</p>
</li>
<li>
<p><a href="http://www.nickpolet.com/blog/deploying-django-on-aws/1/">Deploying Django on AWS</a>
is another walkthrough for deploying Django to AWS.</p>
</li>
<li>
<p><a href="https://github.com/rosarior/awesome-django">django-awesome</a> is a curated
list of Django libraries and resources.</p>
</li>
<li>
<p><a href="https://realpython.com/learn/start-django/">Starting a Django Project</a> answers the question, “How do I set up a Django (1.5, 1.6, or /1.7) project from scratch?”</p>
</li>
<li>
<p>The <a href="http://www.revsys.com/blog/2014/nov/21/recommended-django-project-layout/">recommended Django project layout</a>
is helpful for developers new to Django to understand how to structure
the directories and files within apps for projects.</p>
</li>
<li>
<p>The <a href="http://irisbeta.com/article/245366784/the-django-request-response-cycle/">Django Request-Response Cycle</a>
explains what happens when you visit a webpage generated by Django.</p>
</li>
</ul>
<h2>Django videos</h2>
<ul>
<li>
<p>Kate Heddleston and I gave a talk at DjangoCon 2014 called
<a href="https://www.youtube.com/watch?v=QrFEKghISEI">Choose Your Own Django Deployment Adventure</a>
which walked through many of the scenarios you'd face when deploying your
first Django website.</p>
</li>
<li>
<p><a href="https://godjango.com/">GoDjango</a> screencasts and tutorials are free short
videos for learning how to build Django applications.</p>
</li>
<li>
<p><a href="http://gettingstartedwithdjango.com/">Getting Started with Django</a> is a
series of video tutorials for the framework.</p>
</li>
<li>
<p>The videos and slides from
<a href="http://www.djangounderthehood.com/talks/">Django: Under the Hood 2014</a>
are from Django core commiters and provide insight into the ORM,
internationalization, templates and other topics.</p>
</li>
<li>
<p>DjangoCon US videos from
<a href="https://www.youtube.com/playlist?list=PLE7tQUdRKcybbNiuhLcc3h6WzmZGVBMr3">2014</a>,
<a href="http://www.youtube.com/user/TheOpenBastion/videos">2013</a>,
<a href="http://pyvideo.org/category/23/djangocon-2012">2012</a>,
<a href="http://pyvideo.org/category/3/djangocon-2011">2011</a>, as well as<br />
<a href="http://pyvideo.org/category">earlier US and DjangoCon EU conferences</a> are
all available free of charge.</p>
</li>
</ul>
<h2>Django 1.7-specific resources</h2>
<ul>
<li>
<p>Paul Hallett wrote a
<a href="https://www.twilio.com/blog/2014/10/upgrading-your-django-reusable-app-to-support-django-1-7.html">detailed Django 1.7 app upgrade guide</a>
on the Twilio blog from his experience working with the django-twilio
package.</p>
</li>
<li>
<p><a href="http://pyvideo.org/video/2630/designing-djangos-migrations">Designing Django's Migrations</a>
covers Django 1.7's new migrations from the main programmer
of South and now Django's built-in migrations, Andrew Godwin.</p>
</li>
<li>
<p>Real Python's <a href="https://realpython.com/blog/python/django-migrations-a-primer/">migrations primer</a>
explores the difference between South's migrations and the built-in
Django 1.7 migrations as well as how you use them.</p>
</li>
<li>
<p>Andrew Pinkham's "Upgrading to Django 1.7" series is great learning
material for understanding what's changed in this major release and
how to adapt your Django project.
<a href="http://andrewsforge.com/article/upgrading-django-to-17/part-1-introduction-and-django-releases/">Part 1</a>,
<a href="http://andrewsforge.com/article/upgrading-django-to-17/part-2-migrations-in-django-16-and-17/">part 2</a> and
<a href="http://andrewsforge.com/article/upgrading-django-to-17/part-3-django-17-new-features/">part 3</a>
and
<a href="http://andrewsforge.com/article/upgrading-django-to-17/part-4-upgrade-strategies/">part 4</a>
are now all available to read.</p>
</li>
<li>
<p><a href="https://lincolnloop.com/blog/integrating-front-end-tools-your-django-project/">Integerating Front End Tools with Django</a>
is a good post to read for figuring out how to use <a href="http://gulpjs.com/">Gulp</a>
for handling front end tools in development and production Django sites.</p>
</li>
</ul>
<h2>Django with Angular (Djangular) resources</h2>
<ul>
<li>
<p><a href="http://blog.kevinastone.com/getting-started-with-django-rest-framework-and-angularjs.html">Getting Started with Django Rest Framework and AngularJS</a>
is a very detailed introduction to Djangular with example code. </p>
</li>
<li>
<p><a href="https://thinkster.io/brewer/angular-django-tutorial/">Building Web Applications with Django and AngularJS</a>
is a very detailed guide for using Django as an API layer and AngularJS
as the MVC front end in the browser.</p>
</li>
<li>
<p>This <a href="http://blog.mourafiq.com/post/55034504632/end-to-end-web-app-with-django-rest-framework">end to end web app with Django-Rest-Framework & AngularJS part 1</a>
tutorial along with
<a href="http://blog.mourafiq.com/post/55099429431/end-to-end-web-app-with-django-rest-framework">part 2</a>,
<a href="http://blog.mourafiq.com/post/58725341511/end-to-end-web-app-with-django-rest-framework">part 3</a>
and
<a href="http://blog.mourafiq.com/post/58726121556/end-to-end-web-app-with-django-rest-framework">part 4</a>
creates an example blog application with Djangular. There is also a
corresponding <a href="https://github.com/mouradmourafiq/django-angular-blog">GitHub repo</a>
for the project code.</p>
</li>
</ul>
<h2>Django ORM resources</h2>
<p>The <a href="https://docs.djangoproject.com/en/dev/topics/db/">Django ORM</a> works well
for simple and medium-complexity database operations. However, there are often
complaints that the ORM makes complex queries much more complicated than
writing straight SQL or using <a href="http://www.sqlalchemy.org/">SQLAlchemy</a>. </p>
<p>It's technically possible to drop down to SQL but it ties the queries to a
specific database implementation. The ORM is coupled closely with Django so
replacing the default ORM with SQLAlchemy is currently a hack workaround. Note
though that some of the Django core committers believe it is only a matter of
time before the default ORM is replaced with SQLAlchemy. It will be a large
effort to get that working though so it's likely to come in Django 1.9 or
later.</p>
<p>Since the majority of Django projects are tied to the default ORM, it's best to
read up on advanced use cases and tools for doing your best work within the
existing framework.</p>
<ul>
<li>
<p><a href="http://www.dabapps.com/blog/django-models-and-encapsulation/">Django models, encapsulation and data integrity</a>
is a detailed article by Tom Christie on encapsulating Django models for
data integrity.</p>
</li>
<li>
<p><a href="http://django-debug-toolbar.readthedocs.org/en/1.2/">Django Debug Toolbar</a>
is a powerful Django ORM database query inspection tool. Highly recommended
during development to ensure you're writing reasonable query code.
<a href="http://mtford.co.uk/blog/2/">Django Silk</a> is another inspection tool and
has capabilities to do more than just SQL inspection.</p>
</li>
<li>
<p><a href="http://reinout.vanrees.org/weblog/2014/05/06/making-faster.html">Making a specific Django app faster</a>
is a Django performance blog post with some tips on measuring performance
and optimizing based on the measured results.</p>
</li>
<li>
<p><a href="https://speakerdeck.com/alex/why-i-hate-the-django-orm">Why I Hate the Django ORM</a>
is Alex Gaynor's overview of the bad designs decisions, some of which he
made, while building the Django ORM.</p>
</li>
<li>
<p><a href="https://speakerdeck.com/craigkerstiens/going-beyond-django-orm-with-postgres">Going Beyond Django ORM with Postgres</a>
is specific to using PostgreSQL with Django.</p>
</li>
<li>
<p><a href="http://www.calazan.com/migrating-django-app-from-mysql-to-postgresql/">Migrating a Django app from MySQL to PostgreSQL</a>
is a quick look at how to move from MySQL to PostgreSQL. However, my guess
is that any Django app that's been running for awhile on one relational
database will require a lot more work to port over to another backend
even with the power of the ORM.</p>
</li>
<li>
<p><a href="http://blog.kevinastone.com/django-model-descriptors.html">Django Model Descriptors</a>
discusses and shows how to incorporate business logic into Django models
to reduce complexity from the views and make the code easier to reuse across
separate views.</p>
</li>
</ul>
<h2>Static and media files</h2>
<p>Deploying and handling static and media files can be confusing for new
Django developers. These resources along with the
<a href="/static-content.html">static content</a> page are useful for figuring out how
to handle these files properly.</p>
<ul>
<li>
<p><a href="http://www.caktusgroup.com/blog/2014/11/10/Using-Amazon-S3-to-store-your-Django-sites-static-and-media-files/">Using Amazon S3 to Store your Django Site's Static and Media Files</a>
is a well written guide to a question commonly asked about static and
media file serving.</p>
</li>
<li>
<p><a href="http://www.revsys.com/blog/2014/dec/03/loading-django-files-from-code/">Loading Django FileField and ImageFields from the file system</a>
shows how to load a model field with a file from the file system.</p>
</li>
</ul>
<h2>Open source Django example projects</h2>
<ul>
<li>
<p><a href="https://github.com/makaimc/txt2react">Txt 2 React</a> is a full Django web
app that allows audiences to text in during a presentation with feedback
or questions.</p>
</li>
<li>
<p><a href="https://github.com/ustream/openduty">Openduty</a> is a website status checking
and alert system similar to PagerDuty.</p>
</li>
<li>
<p><a href="https://github.com/myusuf3/courtside">Courtside</a> is a pick up sports web
application written and maintained by the author of PyCoder's Weekly.</p>
</li>
<li>
<p>These two Django Interactive Voice Response (IVR) system web application
repositorities <a href="https://github.com/phalt/twilio-django-part-1">part 1</a> and
<a href="https://github.com/phalt/twilio-django-part-2">part 2</a> show you how to
build a really cool Django application. There's also an accompanying
<a href="https://www.twilio.com/blog/2014/07/build-an-ivr-system-with-twilio-and-django.html">blog post</a>
with detailed explanations of each step.</p>
</li>
<li>
<p><a href="https://github.com/taigaio/taiga-back">Taiga</a> is a project management
tool built with Django as the backend and AngularJS as the front end.</p>
</li>
</ul>
<h2>Django project templates</h2>
<ul>
<li>
<p><a href="https://github.com/caktus/django-project-template">Caktus Group's Django project template</a>
is Django 1.6+ ready.</p>
</li>
<li>
<p><a href="https://github.com/pydanny/cookiecutter-django">Cookiecutter Django</a> is a
project template from Daniel Greenfeld, for use with Audrey Roy's
<a href="https://github.com/audreyr/cookiecutter">Cookiecutter</a>. Heroku
deployment-ready.</p>
</li>
<li>
<p><a href="https://github.com/twoscoops/django-twoscoops-project">Two Scoops Django project template</a>
is also from the PyDanny and Audrey Roy. This one provides a quick scaffold
described in the Two Scoops of Django book.</p>
</li>
</ul>
<h2>Django learning checklist</h2>
<p><i class="fa fa-check-square-o"></i>
<a href="https://docs.djangoproject.com/en/dev/topics/install/">Install Django</a> on
your local development machine.</p>
<p><i class="fa fa-check-square-o"></i>
Work through the initial
<a href="https://docs.djangoproject.com/en/dev/intro/tutorial01/">"polls" tutorial</a>.</p>
<p><i class="fa fa-check-square-o"></i>
Build a few more simple applications using the tutorial resources found
in the "Django resources" section.</p>
<p><i class="fa fa-check-square-o"></i>
Start coding your own Django project with help from the
<a href="https://docs.djangoproject.com/en/dev/">official documentation</a> and
resource links below. You'll make plenty of mistakes which is critical
on your path to learning the right way to build applications.</p>
<p><i class="fa fa-check-square-o"></i>
Read <a href="http://www.amazon.com/Two-Scoops-Django-Best-Practices/dp/098146730X/ref=sr_1_2?ie=UTF8&qid=1391562062&sr=8-2&tag=mlinar-20">2 Scoops of Django</a>
to understand Django best practices and learn better ways of building
Django web applications.</p>
<p><i class="fa fa-check-square-o"></i>
Move on to the <a href="/deployment.html">deployment section</a> to get your Django
project on the web.</p>
<h3>What do you need to learn next for your Django app?</h3>
<h1>Flask</h1>
<p><a href="http://flask.pocoo.org/">Flask</a> is a Python web framework built with a
<a href="http://flask.pocoo.org/docs/design/">small core and easy-to-extend philosophy</a>.
<a href="http://flask.pocoo.org/" style="border: none;"><img src="theme/img/flask.png" width="100%" alt="Official Flask logo. Flask Artwork License." class="technical-diagram" /></a></p>
<h2>Why is Flask a good web framework choice?</h2>
<p>Flask is considered more
<a href="http://blog.startifact.com/posts/older/what-is-pythonic.html">Pythonic</a>
than Django because Flask web application code is in most cases more explicit.
Flask is easy to get started with as a beginner because there is little
boilerplate code for getting a simple app up and running. </p>
<p>For example, here's a valid "hello world" web application with Flask (the
equivalent in Django would be significantly more code):</p>
<div class="codehilite"><pre><span class="n">from</span> <span class="n">flask</span> <span class="n">import</span> <span class="n">Flask</span>
<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>
<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">'/'</span><span class="p">)</span>
<span class="n">def</span> <span class="n">hello_world</span><span class="p">()</span><span class="o">:</span>
<span class="k">return</span> <span class="err">'</span><span class="n">Hello</span> <span class="n">World</span><span class="o">!</span><span class="err">'</span>
<span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="err">'</span><span class="n">__main__</span><span class="err">'</span><span class="o">:</span>
<span class="n">app</span><span class="p">.</span><span class="n">run</span><span class="p">()</span>
</pre></div>
<p>Flask was also written several years after Django and therefore
learned from the Python community's reactions as the framework evolved.
Jökull Sólberg wrote a great piece articulating to this effect in his
<a href="http://jokull.calepin.co/my-flask-to-django-experience.html">experience switching between Flask and Django</a>.</p>
<h2>Flask resources</h2>
<p>The 18-part Flask mega tutorial is an absolutely amazing starting
resource for using the Flask framework. Yes, there are a lot of posts in
the series. However, each post is focused on a single topic to contain
the complexity while the reader is learning the framework. The whole
series is well worth an in-depth read-through. The
<a href="https://twitter.com/miguelgrinberg">author</a> also wrote the new
<a href="http://shop.oreilly.com/product/0636920031116.do">O'Reilly Flask Web Development</a>
book which is an excellent learning resource.</p>
<ul>
<li><a href="http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world">Part 1: Hello World</a></li>
<li><a href="http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-ii-templates">Part 2: Templates</a></li>
<li><a href="http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-iii-web-forms">Part 3: Web Forms</a></li>
<li><a href="http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-iv-database">Part 4: Database</a></li>
<li><a href="http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-v-user-logins">Part 5: User Logins</a></li>
<li><a href="http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-vi-profile-page-and-avatars">Part 6: Profile Page and Avatars</a></li>
<li><a href="http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-vii-unit-testing">Part 7: Unit Testing</a></li>
<li><a href="http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-viii-followers-contacts-and-friends">Part 8: Followers, Contacts, and Friends</a></li>
<li><a href="http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-ix-pagination">Part 9: Pagination</a></li>
<li><a href="http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-x-full-text-search">Part 10: Full Text Search</a></li>
<li><a href="http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xi-email-support">Part 11: Email Support</a></li>
<li><a href="http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xii-facelift">Part 12: Facelift</a></li>
<li><a href="http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xiii-dates-and-times">Part 13: Dates and Times</a></li>
<li><a href="http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xiv-i18n-and-l10n">Part 14: I18n and L10n</a></li>
<li><a href="http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xv-ajax">Part 15: Ajax</a></li>
<li><a href="http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xvi-debugging-testing-and-profiling">Part 16: Debugging, Testing and Profiling</a></li>
<li><a href="http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xvii-deployment-on-linux-even-on-the-raspberry-pi">Part 17: Deployment on Linux</a></li>
<li>
<p><a href="http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xviii-deployment-on-the-heroku-cloud">Part 18: Deployment on the Heroku Cloud</a></p>
</li>
<li>
<p>If you're looking for a fun introduction to Flask and WebSockets, check out
my blog post on creating
<a href="https://www.twilio.com/blog/2014/11/choose-your-own-adventure-presentations-with-reveal-js-python-and-websockets.html">Choose Your Own Adventure Presentations with Reveal.js, Python and WebSockets</a>.
That post is my favorite technical walkthrough I've written to date. There
is also a companion open source
<a href="https://github.com/makaimc/choose-your-own-adventure-presentations">GitHub repository</a>
for the app with tags for each step in the blog post.</p>
</li>
<li>
<p><a href="https://www.twilio.com/blog/2014/10/branded-mms-coupon-generation-with-python-and-twilio.html">Branded MMS Coupon Generation with Python and Twilio</a>
is a Flask tutorial I wrote for building a web application that can send
branded barcode coupons via MMS. The post goes through every step from
a blank directory until you have a working app that you can deploy to
Heroku.</p>
</li>
<li>
<p><a href="http://blog.john.mayonvolcanosoftware.com/building-a-blog-using-flask-and-angularjs-part-1/">Building a blog using Flask and AngularJS Part 1</a>
is the first of a multipart series on working with Flask and an AngularJS
front end.
<a href="http://blog.john.mayonvolcanosoftware.com/building-a-blog-using-flask-and-angularjs-part-2/">Part 2</a> is also available
<a href="https://github.com/basco-johnkevin/building-a-blog-using-flask-and-angularjs">along with the source code</a>.</p>
</li>
<li>
<p><a href="http://flask.pocoo.org/extensions/">The Flask Extensions Registry</a> is a
curated list of the best packages that extend Flask. It's the first location
to look through when you're wondering how to do something that's not in the
core framework.</p>
</li>
<li>
<p><a href="http://exploreflask.com/">Explore Flask</a> is a public domain book that
was previously backed on Kickstarter and cost money for about a year before
being open sourced. The book explains best practices and patterns for
building Flask apps.</p>
</li>
<li>
<p>Randall Degges wrote a detailed walkthrough for
<a href="https://stormpath.com/blog/build-a-flask-app-in-30-minutes/">building a Flask app in 30 minutes</a>.</p>
</li>
<li>
<p><a href="http://charlesleifer.com/blog/saturday-morning-hacks-building-an-analytics-app-with-flask/">Building an Analytics App with Flask</a>
is a detailed walkthrough for collecting and analyzing webpage
analytics with your own Flask app.</p>
</li>
<li>
<p>Nice post by Jeff Knupp on <a href="http://www.jeffknupp.com/blog/2014/01/29/productionizing-a-flask-application/">Productionizing a Flask App</a>.</p>
</li>
<li>
<p><a href="http://maximebf.com/blog/2012/10/building-websites-in-python-with-flask/#.U06EZ-ZdW4J">Building Websites in Python with Flask</a>
is another walkthrough tutorial from first steps through
<a href="http://maximebf.com/blog/2012/11/getting-bigger-with-flask/">getting bigger with Flask</a>.</p>
</li>
<li>
<p>The Plank & Whittle blog has two posts, one on
<a href="http://www.plankandwhittle.com/packaging-a-flask-web-app/">Packaging a Flask web app</a>
and another on
<a href="http://www.plankandwhittle.com/packaging-a-flask-app-in-a-debian-package/">Packaging a Flask app in a Debian package</a>
once you've built an app and want to deploy it.</p>
</li>
<li>
<p>The Tuts+ <a href="http://code.tutsplus.com/tutorials/an-introduction-to-pythons-flask-framework--net-28822">Flask tutorial</a>
is another great walkthrough for getting started with the framework.</p>
</li>
<li>
<p><a href="http://readwrite.com/2014/07/11/one-click-messaging-app">Create Your Own Obnoxiously Simple Messaging App Just Like Yo</a>
is a silly walkthrough of very basic Flask web application that uses
<a href="https://www.nitrous.io/">Nitrous.io</a> to get started and
<a href="https://www.twilio.com/">Twilio</a> for SMS.</p>
</li>
<li>
<p>The blog post series "Things which aren't magic" covers how Flask's
ubiquitous @app.route decorator works under the covers. There are two
parts in the series,
<a href="http://ains.co/blog/things-which-arent-magic-flask-part-1.html">part 1</a>
and
<a href="http://ains.co/blog/things-which-arent-magic-flask-part-2.html">part 2</a>.</p>
</li>
<li>
<p><a href="http://www.realpython.com/blog/python/flask-by-example-part-1-project-setup/">Flask by Example: Part 1</a>
shows the basic first steps for setting up a Flask project.
<a href="http://www.realpython.com/blog/flask-by-example-part-2-postgres-sqlalchemy-and-alembic/">Part 2</a>
explains how to use PostgreSQL, SQLAlchemy and Alembic.
<a href="https://realpython.com/blog/python/flask-by-example-part-3-text-processing-with-requests-beautifulsoup-nltk/">Part 3</a>
describes text processing with BeautifulSoup and NLTK.
<a href="https://realpython.com/blog/python/flask-by-example-implementing-a-redis-task-queue/">Part 4</a>
shows how to build a task queue with Flask and Redis.</p>
</li>
<li>
<p>Along with the above FLask by Example series, there's also a
<a href="https://github.com/realpython/discover-flask">Discover Flask</a> series of
videos. The GitHub repo contains the code and the 25+ videos are hosted
on YouTube.</p>
</li>
<li>
<p><a href="https://www.digitalocean.com/community/articles/how-to-structure-large-flask-applications">How to Structure Large Flask Applications</a>
covers a subject that comes up quickly once you begin adding significant
functionality to your Flask application.</p>
</li>
<li>
<p><a href="http://blog.miguelgrinberg.com/post/video-streaming-with-flask">Video streaming with Flask</a>
is another fantastic tutorial by Miguel Grinberg that covers video
streaming.</p>
</li>
<li>
<p>"<a href="https://medium.com/@5hreyans/the-one-weird-trick-that-cut-our-flask-page-load-time-by-70-87145335f679">One line of code cut our Flask page load times by 60%</a>
is an important note about optimizing Flask template cache size to
dramatically increase performance in some cases.</p>
</li>
<li>
<p><a href="https://www.twilio.com/blog/2014/03/unit-testing-your-twilio-app-using-pythons-flask-and-nose.html">Unit Testing Your Twilio App Using Python’s Flask and Nose</a>
covers integrating the Twilio API into a Flask application and how to test
that functionality with <a href="https://nose.readthedocs.org/en/latest/">nose</a>.</p>
</li>
<li>
<p>The Flask documentation has some quick examples for how to deploy Flask
with
<a href="http://flask.pocoo.org/docs/deploying/wsgi-standalone/">standalone WSGI containers</a>.</p>
</li>
<li>
<p><a href="https://realpython.com/blog/python/handling-email-confirmation-in-flask/">Handling Email Confirmation in Flask</a>
is a great walkthrough for a common use case of ensuring an email address
matches with the user's login information.</p>
</li>
</ul>
<h2>Open source Flask example projects</h2>
<ul>
<li>
<p><a href="https://github.com/miguelgrinberg/microblog">Microblog</a> is the companion
open source project that goes along with Miguel Grinberg's O'Reilly Flask
book.</p>
</li>
<li>
<p><a href="https://github.com/JackStouffer/Flask-Foundation">Flask Foundation</a> is a
starting point for new Flask projects. There's also a
<a href="https://jackstouffer.github.io/Flask-Foundation/">companion website</a> for
the project that explains what extensions the base project includes.</p>
</li>
<li>
<p><a href="https://github.com/sloria/cookiecutter-flask">Cookiecutter Flask</a> is a project
template for use with <a href="https://github.com/audreyr/cookiecutter">Cookiecutter</a>.</p>
</li>
<li>
<p><a href="https://github.com/mjhea0/flaskr-tdd">Flaskr TDD</a> takes the official Flask
tutorial and adds test driven development and JQuery to the project. </p>
</li>
<li>
<p>Use the <a href="https://github.com/kamalgill/flask-appengine-template">Flask App Engine Template</a>
for getting set up on Google App Engine with Flask.</p>
</li>
<li>
<p>Here is a
<a href="http://charlesleifer.com/blog/saturday-morning-hack-a-little-note-taking-app-with-flask/">note-taking app</a>
along with the
<a href="https://gist.github.com/coleifer/632d3c9aa6b2ea519384">source code in Gists</a>.</p>
</li>
<li>
<p><a href="https://github.com/BouncyNudibranch/bean-counter">Bean Counter</a> is an
open source Flask app for tracking coffee.</p>
</li>
<li>
<p><a href="http://flaskbb.org/">FlaskBB</a> is a Flask app for a discussion forum.</p>
</li>
<li>
<p><a href="https://github.com/Jahaja/psdash">psdash</a> is an app built with Flask and
psutils to display information about the computer it is running on.</p>
</li>
</ul>
<h2>Flask framework learning checklist</h2>
<p><i class="fa fa-check-square-o"></i>
<a href="http://flask.pocoo.org/docs/installation/">Install Flask</a> on
your local development machine.</p>
<p><i class="fa fa-check-square-o"></i>
Work through the 18-part Flask tutorial listed first under "Flask resources"
below.</p>
<p><i class="fa fa-check-square-o"></i>
Read through <a href="http://flask.pocoo.org/extensions/">Flask Extensions Registry</a>
to find out what extensions you'll need to build your project.</p>
<p><i class="fa fa-check-square-o"></i>
Start coding your Flask app based on what you learned from the 18 part
Flask tutorial plus open source example applications found below. </p>
<p><i class="fa fa-check-square-o"></i>
Move on to the <a href="/deployment.html">deployment section</a> to get your initial
Flask project on the web.</p>
<h3>What do you need to learn about web frameworks next?</h3>
<h1>Bottle</h1>
<p><a href="http://bottlepy.org/docs/dev/index.html">Bottle</a> is a WSGI-compliant
<a href="https://github.com/defnull/bottle/blob/master/bottle.py">single source file</a>
web framework with no external dependencies except for the standard library
included with Python.</p>
<h2>Bottle resources</h2>
<ul>
<li>
<p>The <a href="http://bottlepy.org/docs/dev/tutorial.html">official Bottle tutorial</a>
provides a thorough view of basic concepts and features for the framework.</p>
</li>
<li>
<p>Digital Ocean provides an extensive <a href="https://www.digitalocean.com/community/articles/how-to-use-the-bottle-micro-framework-to-develop-python-web-apps">introductory post on Bottle</a>.</p>
</li>
<li>
<p>This tutorial provides a walkthrough for
<a href="http://www.giantflyingsaucer.com/blog/?p=3598">getting started with Bottle</a>.</p>
</li>
<li>
<p>Here's a short code snippet for
<a href="http://myadventuresincoding.wordpress.com/2011/01/02/creating-a-rest-api-in-python-using-bottle-and-mongodb/">creating a RESTful API with Bottle and MongoDB</a>.</p>
</li>
<li>
<p>This <a href="http://gotofritz.net/blog/weekly-challenge/restful-python-api-bottle/">tutorial</a>
is another Bottle walkthrough for creating a RESTful web API.</p>
</li>
<li>
<p><a href="http://reachtim.com/articles/BAM-Short-Stack.html">BAM! A Web Framework "Short Stack"</a>
is a walkthrough of using Bottle, Apache and MongoDB to create a web
application.</p>
</li>
<li>
<p><a href="http://gengo.github.io/decanter/">Decanter</a> is a library for structuring
Bottle projects.</p>
</li>
</ul>
<h2>Open source Bottle example projects</h2>
<ul>
<li><a href="https://github.com/thekad/pasttle">Pattle</a> is a pastebin clone built with
Bottle.</li>
</ul>
<h2>Bottle framework learning checklist</h2>
<p><i class="fa fa-check-square-o"></i>
<a href="https://github.com/defnull/bottle/raw/master/bottle.py">Download Bottle</a> or
install via pip with <code>pip install bottle</code> on your local development machine.</p>
<p><i class="fa fa-check-square-o"></i>
Work through the official
<a href="http://bottlepy.org/docs/dev/tutorial.html">Bottle tutorial</a>.</p>
<p><i class="fa fa-check-square-o"></i>
Start coding your Bottle app based on what you learned in the official
tutorial plus reading open source example applications found below. </p>
<p><i class="fa fa-check-square-o"></i>
Move on to the <a href="/deployment.html">deployment section</a> to get your initial
Bottle application on the web.</p>
<h3>What do you need to learn next?</h3>
<h2>Morepath</h2>
<p><a href="http://morepath.readthedocs.org/en/latest/">Morepath</a> is a micro web
framework with a model-driven approach to creating web applications and web
APIs.</p>
<p>Morepath's framework philosophy is that the data models should drive the
creation via the web framework. By default the framework routes URLs directly
to model code, unlike for example Django which requires explicit URL routing
by the developer.</p>
<h2>Why is Morepath an interesting web framework?</h2>
<p>Simple <a href="http://en.wikipedia.org/wiki/Create,_read,_update_and_delete">CRUD web applications and APIs</a>
can be tedious to build when they are driven straight from data models without
much logic between the model and the view. </p>
<p>With the rise of front end JavaScript frameworks, many Python web frameworks
are first being used to build
<a href="/application-programming-interfaces.html">RESTful APIs</a> that return JSON
instead rendering HTML via a templating system. Morepath appears to have
been created with the RESTful API model approach in mind and cuts out the
assumption that templates will drive the user interface.</p>
<h3>Morepath resources</h3>
<ul>
<li>
<p><a href="http://blog.startifact.com/posts/on-the-morepath.html">On the Morepath</a>
is a blog post by Startifact on how they use Morepath and some of the
features of the framework.</p>
</li>
<li>
<p>Morepath's creator gave a
<a href="https://www.youtube.com/watch?v=gyDKMAWPyuY">great talk on the motivation and structure for the new framework</a>
at EuroPython 2014.</p>
</li>
</ul>
<h3>Do you want to learn more about frameworks or web APIs?</h3>
<h1>Other Web Frameworks</h1>
<p>Python has a significant number of web frameworks outside the usual Django,
Flask and Bottle suspects.</p>
<h2>Pyramid</h2>
<p>The <a href="http://www.pylonsproject.org/">Pyramid framework</a> stems from the Pylons
project which develops a set of open source web application frameworks.
Pyramid applications are built using a model-view-controller architecture.</p>
<h2>TurboGears2</h2>
<p><a href="http://www.turbogears.org">TurboGears2</a> born as a full stack layer on top
of Pylons is now a standalone web framework that can act both as a full stack
solution (like Django) or as a micro framework.</p>
<h2>Falcon</h2>
<p><a href="http://falconframework.org/">Falcon</a> is a minimalist web framework designed
with web application speed as a top priority.</p>
<h2>web.py</h2>
<p><a href="http://webpy.org/">web.py</a> is a Python web framework designed for simplicity
in building web applications.</p>
<ul>
<li>See this Reddit discussion on
<a href="http://www.reddit.com/r/Python/comments/2sjghv/is_there_any_reason_to_not_use_webpy/">reasons why to not use web.py</a>
for some insight into the state of the project.</li>
</ul>
<h2>web2py</h2>
<p><a href="http://www.web2py.com/">Web2py</a> is a batteries-included philosophy framework
with project structure based on model-view-controller patterns.</p>
<h2>CherryPy</h2>
<p><a href="http://www.cherrypy.org/">CherryPy</a> is billed as a minimalist web framework,
from the perspective of the amount of code needed to write a web application
using the framework. The project has a
<a href="http://w3techs.com/technologies/details/ws-cherrypy/all/all">long history</a>
and made a major transition between the second and third release. There's an
<a href="https://groups.google.com/forum/#!msg/cherrypy-users/lT1cxovGyy8/JKCPrE51CXIJ">interesting recent discussion</a>
about moving the project forward, especially the number of open outstanding
issues that exist in the tracker.</p>
<h2>Other web framework resources</h2>
<ul>
<li>
<p>This <a href="http://codecondo.com/14-minimal-web-frameworks-for-python/">roundup of 14 minimal Python frameworks</a>
contains both familiar and less known Python libraries.</p>
</li>
<li>
<p>The <a href="http://www.slideshare.net/r1chardj0n3s/web-microframework-battle/">web micro-framework battle</a>
presentation goes over Bottle, Flask, and many other lesser known Python
web frameworks.</p>
</li>
<li>
<p>A Python newcomer asked the Python Subreddit to
<a href="http://www.reddit.com/r/Python/comments/28qr7c/can_anyone_explain_the_differences_between_web2py/">explain the differences between numerous Python web frameworks</a>
and received some interesting responses from other users.</p>
</li>
</ul>
<h2>Other frameworks learning checklist</h2>
<p><i class="fa fa-check-square-o"></i>
Read through the web frameworks listed above and check out their project
websites. </p>
<p><i class="fa fa-check-square-o"></i>
It's useful to know what other web frameworks exist besides Django and Flask.
However, when you're just starting to learn to program there are significantly
more tutorials and resources for <a href="/django.html">Django</a> and
<a href="/flask.html">Flask</a> on the web. My recommendation is to start with one of
those two frameworks then expand your knowledge from there.</p>
<h3>What do you need to learn next?</h3>
<h1>Deployment</h1>
<p>Deployment involves packaging up your web application and putting it in a
production environment that can run the app.</p>
<h2>Why is deployment necessary?</h2>
<p>Your web application must live somewhere other than your own desktop or
laptop. A production environment is the canonical version of your current
application and its associated data.</p>
<h2>Deployment topics map</h2>
<p>Python web application deployments are comprised of many pieces that need to
be individually configured. Here is a map that visually depicts how each
deployment topic relates to each other. Click the image to pull up a PDF
version.</p>
<p><a href="/full-stack-python-map.pdf" target="_blank" style="border: none;"><img src="theme/img/full-stack-python-map.png" width="100%" alt="Full Stack Python site map." class="technical-diagram" /></a></p>
<h2>Deployment hosting options</h2>
<p>There are four options for deploying and hosting a web application:</p>
<ol>
<li>
<p><a href="/servers.html">"Bare metal" servers</a></p>
</li>
<li>
<p><a href="/servers.html">Virtualized servers</a></p>
</li>
<li>
<p><a href="/servers.html">Infrastructure-as-a-service</a></p>
</li>
<li>
<p><a href="/platform-as-a-service.html">Platform-as-a-service</a></p>
</li>
</ol>
<p>The first three options are similar. The deployer needs to provision one or
more servers with a Linux distribution. System packages, a web server,
WSGI server, database and the Python environment are then installed. Finally
the application can be pulled from source and installed in the environment.</p>
<p>Note that there are other ways of installing a Python web application through
system-specific package management systems. We won't cover those in this
guide as they are considered advanced deployment techniques.</p>
<h2>Deployment resources</h2>
<ul>
<li>
<p><a href="http://omniti.com/seeds/thoughts-on-web-application-deployment">Thoughts on web application deployment</a>
walks through stages of deployment with source control, planning,
continuous deployment and monitoring the results.</p>
</li>
<li>
<p><a href="http://blogs.atlassian.com/2014/04/practical-continuous-deployment/">Practical continuous deployment</a>
defines delivery versus deployment and walks through a continuous deployment
workflow.</p>
</li>
<li>
<p>If you're using Flask this
<a href="https://realpython.com/blog/python/kickstarting-flask-on-ubuntu-setup-and-deployment/">detailed post on deploying it to Ubuntu</a>
is a great way to familiarize yourself with the deployment process.</p>
</li>
</ul>
<h2>Deployment learning checklist</h2>
<p><i class="fa fa-check-square-o"></i>
If you're tight on time look at the
<a href="/platform-as-a-service.html">platform-as-a-service (PaaS)</a> options. You can
deploy a low traffic project web app for free or low cost. You won't have to
worry about setting up the operating system and web server compared to going
the traditional server route. In theory you should be able to get your
application live on the web sooner with PaaS hosting.</p>
<p><i class="fa fa-check-square-o"></i>
<a href="/servers.html">Traditional server options</a> are your best bet for learning
how the entire Python web stack works. You'll often save money with a virtual
private server instead of a platform-as-a-service as you scale up.</p>
<p><i class="fa fa-check-square-o"></i>
Read about servers, <a href="/operating-systems.html">operating systems</a>,
<a href="/web-servers.html">web servers</a> and <a href="/wsgi-servers.html">WSGI servers</a> to get
a broad picture of what components need to be set up to run a Python web
application.</p>
<h3>How would you like to deploy your web app?</h3>
<h1>Servers</h1>
<p>Servers are the physical infrastructure to run all the layers of software
so your web application can respond to requests from clients such as web
browsers.</p>
<h2>Why are servers necessary?</h2>
<p>Your web application must live somewhere other than your own desktop or
laptop. Servers should ideally be accessible 24 hours a day, 7 days a week,
with no unplanned downtime. The servers that host your web application for
actual users (as opposed to test users) are known as <em>production</em> servers.
Production servers hold real data (again as opposed to test data) and must be
secure against unauthorized access.</p>
<h2>"Bare metal" servers</h2>
<p>The term <em>bare metal</em> refers to purchasing the actual hardware and hooking
it up to the Internet either through a business-class internet service
provider (ISP) or
<a href="http://webdesign.about.com/od/colocation/a/what_colocation.htm">co-locating the server</a>
with other servers. A "business-class" ISP is necessary because
most residential Internet service agreements explicitly prohibit running
web servers on their networks. You may be able to get away with low traffic
volume but if your site serves a lot of traffic it will alert an ISP's
filters.</p>
<p>The bare metal option offers the most control over the server configuration,
usually has the highest performance for the price, but also is the most
expensive upfront option and the highest ongoing maintenance. With bare
metal servers the ongoing operating cost is the electricity the server(s)
use as well as handling repairs when server components malfunction. You're
taking on manual labor working with hardware as well as the rest of the
software stack.</p>
<p>Buy actual hardware from a vendor either pre-built or as a collection of
components that you assemble yourself. You can also buy
pre-configured servers from Dell or HP. Those servers tend to be in
smaller case form factors (called "blades") but are correspondingly more
expensive than putting off-the-shelf components together yourself in a
standard computer case.</p>
<h2>Virtualized servers</h2>
<p>Virtual private servers (VPSs) are slices of hardware on top of a larger
bare metal server. Virtualization software such as
<a href="http://www.xen.org/">Xen</a> and
<a href="http://www.vmware.com/virtualization/what-is-virtualization.html">VMWare</a>
allow providers such as <a href="http://www.linode.com/">Linode</a> and
<a href="http://prgmr.com/xen/">prgmr</a> (as well as a many others) to provide
fractions of a full server that appear as their own instances. For example,