forked from mattmakai/fullstackpython.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathall.html
More file actions
5242 lines (4904 loc) · 313 KB
/
Copy pathall.html
File metadata and controls
5242 lines (4904 loc) · 313 KB
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">
</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="http://daigo3.github.io/fullstackpython.github.com/" 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="http://daigo3.github.io/fullstackpython.github.com/">Full Stack Python</a></span>
</div>
</div>
</div><div class="row">
<div class="col-md-8">
<!--# Introduction-->
<h1>イントロダクション</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 "*ahh-ha*!" 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.-->
あなたは<a href="http://www.python.org/">Python</a>の学習にのめり込んでいます。文法が理解できるようになってきました。Pythonを素晴らしい言語にしているオープンソースのライブラリを使いながら、条件分岐やforループ、クラスを学び理解できるようになります。</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>さあ、あなたのPythonの知識を使って、実際に何かを作りましょう。実際のWebアプリケーションはWeb上で見ることが出来たり、他人にそのサービスを売却することもできるものです。何かを作り始めるならFull Stack Pythonが役に立ちます。プロダクトをデプロイしたり、PythonのWebアプリケーションとして運用するための知識を全て学ぶことができます。</p>
<!--This guide branches out on topic because your learning needs depend on what
you're currently trying to do.-->
<p>あなたがこれからやることに対応できるように、このガイドはトピックごとに分けて書かれています。</p>
<!--### Let's get started. What do you need to do right now?-->
<h3>さっそく始めましょう。まず何からしたいですか?</h3>
<!--# Web frameworks-->
<h1>Webフレームワーク</h1>
<p><!--A web application framework is a code library that makes a developer's life
easier when building reliable, scalable and maintainable web applications.-->
Webアプリケーションフレームワークは、開発者が信頼性が高く、スケーラブルでメンテナンス性の高いWebアプリケーションを構築する手助けをしてくれるライブラリです。</p>
<!--## Why are web frameworks necessary?-->
<h2>なぜWebフレームワークが必要?</h2>
<p><!--Web frameworks encapsulate what developers have learned over the past twenty
years while building dynamic web applications. Frameworks make it easier
to reuse code for common HTTP operations and to structure your code so that
it is maintainable.-->
Webフレームワークには開発者たちが20年間、動的なWebアプリケーションを構築してきたノウハウが詰まっています。一般的なHTTPの操作やメンテナンス性の高いコード構造を簡単に再利用できるように作られています。</p>
<!--## Common web framework functionality-->
<h2>一般的なWebフレームワークの機能</h2>
<p><!--Frameworks provide functionality in their code or through extensions to
perform common operations required to run web applications. These common
operations include:-->
フレームワーク自体が機能を提供している場合もありますし、拡張することによってWebアプリケーションを動作させるのに必要な機能を備えていく物もあります。一般的な機能とは以下の様なものです。</p>
<!--1. URL routing
2. HTML, XML, JSON, and other output format templating
3. Database manipulation
4. Security against Cross-site request forgery (CSRF) and other attacks-->
<ol>
<li>URLのルーティング</li>
<li>HTML、XML、JSONなどのフォーマットを出力するテンプレート</li>
<li>データベースの操作</li>
<li>CSRFなどの脆弱性に対するセキュリティ対策</li>
</ol>
<!--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>すべてのフレームワークが、上記の機能のすべてを備えてるわけではありません。フレームワークは、単純な用途に的を絞って提供されているものもあれば、複雑な機能を全て備えているものもあります。「電池付属(batteries-included)」のアプローチで、すべての機能を提供しているフレームワークがある一方で、フレームワーク自体はシンプルに保ち、特定の機能は拡張機能として提供されているものもあります。</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
[MongoDB](http://www.mongodb.org/).-->
<p>例えば、DjangoというWebアプリケーションフレームワークには関係データベースのCRUD操作を抽象化するためのORM(Object-Relational Mapping)を提供しています。ただし、DjangoのORMでは<a href="http://www.mongodb.org/">MongoDB</a>のようなNOSQLデータベースをそのまま使うことはできません。</p>
<!--Some other web frameworks such as Flask and Pyramid are easier to
use with non-relational databases by incorporating external Python libraries.-->
<p>一方、FlaskやPyramidというフレームワークでは外部のPythonライブラリを利用することで、比較的簡単にNOSQLデータベースを利用することができます。</p>
<!--There is a spectrum between minimal functionality with easy extensibility and
including everything in the framework with tight integration.-->
<p>最小限の機能と拡張性を持つフレームワークから、すべての機能が密に結合されたフレームワークが存在します。</p>
<!--## General web framework resources-->
<h2>Webフレームワークに関する一般的な資料</h2>
<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.-->
* "<a href="http://www.jeffknupp.com/blog/2014/03/03/what-is-a-web-framework/">What is a web framework?</a>" - <a href="https://twitter.com/jeffknupp">Jeff Knupp</a>による記事ではWebフレームワークに関する詳しい説明と、Webサーバとの関係について触れています。</p>
<!--* Check out the answer to the -->
<!-- "[What is a web framework and how does it compare to LAMP?](http://stackoverflow.com/questions/4507506/what-is-a-web-framework-how-does-it-compare-with-lamp)"
question on Stack Overflow.-->
<ul>
<li>Stack Overflowの"<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>"という質問に対する回答を見てみましょう。</li>
</ul>
<!--* [Django vs Flask vs Pyramid: Choosing a Python Web Framework](https://www.airpair.com/python/posts/django-flask-pyramid)
contains background information and code comparisons for similar
web applications built in these three big Python frameworks.-->
<ul>
<li><a href="https://www.airpair.com/python/posts/django-flask-pyramid">Django vs Flask vs Pyramid: Choosing a Python Web Framework</a>では、Pythonの3大Webフレームワークについて、その背景の説明やコードの比較が行われています。</li>
</ul>
<!--* This [Python web framework roundup](http://www.konstruktor.ee/blog/python-web-framework-roundup/)
covers Django, Flask and Bottle as well as several other lesser known Python
frameworks.-->
<ul>
<li><a href="http://www.konstruktor.ee/blog/python-web-framework-roundup/">Python web framework roundup</a>では、Django、Flask、Bottle、その他のWebフレームワークが比較されています。</li>
</ul>
<!--* This fascinating blog post takes a look at the
[code complexity of several Python web frameworks](http://grokcode.com/864/snakefooding-python-code-for-complexity-visualization/)
by providing visualizations based on their code bases.-->
<ul>
<li><a href="http://grokcode.com/864/snakefooding-python-code-for-complexity-visualization/">code complexity of several Python web frameworks</a>では、それぞれのWebフレームワークのコードベースを視覚化しています。</li>
</ul>
<!--* [What web frameworks do you use and why are they awesome?](http://www.reddit.com/r/webdev/comments/2les4x/what_frameworks_do_you_use_and_why_are_they/)
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.-->
<ul>
<li><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>では、Webフレームワークに関する議論が行われています。興味深いのは他の言語を利用している開発者が参加し、PythonのWebフレームワークと比較して、彼らが利用しているWebフレームワークの利点や欠点を話していることです。</li>
</ul>
<!--## Web frameworks learning checklist-->
<h2>Webフレームを学ぶためのチェックリスト</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. -->
有名なPython Webフレームワークを選んで(<a href="/django.html">Django</a>か<a href="/flask.html">Flask</a>がお勧めです)、使ってみましょう。これから始めるのであれば、いろいろなフレームワークをいっぺんに理解しようとするよりも、ひとつのフレームワークを学ぶほうが効果的です。</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.-->
最初にシンプルなアプリケーションを作成し、<a href="./deployment.html">deployment</a>の章を読み公開してみましょう。</p>
<!--### Which web framework do you want to learn about?-->
<h3>どのWebフレームワークを学びたいですか?</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. -->
<a href="http://www.djangoproject.com/">Django</a> は「電池付属(batteries-included)」というコンセプトでPythonのWebフレームワークとして広く利用されています。「電池付属」というのは、Webアプリケーションを構築するための一般的な機能が、他のライブラリを利用するのではなく、フレームワーク自身によって提供されていることを指します。</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>
<!--For example,
[authentication](https://docs.djangoproject.com/en/dev/topics/auth/),
[URL routing](https://docs.djangoproject.com/en/dev/topics/http/urls/), a
[templating system](https://docs.djangoproject.com/en/dev/topics/templates/),
an [object-relational mapper](https://docs.djangoproject.com/en/dev/topics/db/),
and [database schema migrations](https://docs.djangoproject.com/en/dev/topics/migrations/)
(as of version 1.7) are all included with the [Django framework](https://pypi.python.org/pypi/Django/). -->
<p><a href="https://pypi.python.org/pypi/Django/">Django framework</a>では、<a href="https://docs.djangoproject.com/en/dev/topics/auth/">認証</a>、<a href="https://docs.djangoproject.com/en/dev/topics/http/urls/">URLルーティング</a>、<a href="https://docs.djangoproject.com/en/dev/topics/templates/">テンプレートシステム</a>、<a href="https://docs.djangoproject.com/en/dev/topics/db/">ORM</a>や<a href="https://docs.djangoproject.com/en/dev/topics/migrations/">データベースマイグレーション</a>(v1.7以降) が提供されています。</p>
<!-- Compare that included functionality to the Flask framework which requires a
separate library such as
[Flask-Login](https://flask-login.readthedocs.org/en/latest/)
to perform user authentication. -->
<p>ユーザ認証を実装するために<a href="https://flask-login.readthedocs.org/en/latest/">Flask-Login</a>のような、分離したライブラリを必要とするFlaskのようなフレームワークと、組み込みの認証機能を比較してみましょう。</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>電池付属と拡張性という考え方は、単純にフレームワークを作る際のアイデアの違いです。どちらのアイデアが優れているというものではありません。</p>
<!--## Why is Django a good web framework choice?-->
<h2>Djangoを選ぶ利点</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. -->
Djangoプロジェクトは安定していて、性能やコミュニティもフレームワークが作られた当時と比べて飛躍的に向上しています。詳しいチュートリアルやベストプラクティスもWebや書籍で簡単に見つかります。<a href="https://docs.djangoproject.com/en/dev/topics/migrations/">データベースマイグレーション</a>のような、新しい機能の実装にも積極的です。</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 [Django District](http://www.meetup.com/django-district/),
[Django Boston](http://www.meetup.com/djangoboston/) and
[San Francisco Django](http://www.meetup.com/The-San-Francisco-Django-Meetup-Group/)
so new developers can get help when they are stuck.-->
<p>著者としては、最初のフレームワークとしてDjangoをお勧めします。公式ドキュメントやチュートリアルが素晴らしく、<a href="http://www.meetup.com/django-district/">Django District</a>、
<a href="http://www.meetup.com/djangoboston/">Django Boston</a> や
<a href="http://www.meetup.com/The-San-Francisco-Django-Meetup-Group/">San Francisco Django</a>など各地域ごとにユーザグループがあり、初心者が問題を解決しやすいでしょう。</p>
<!--There's some debate on whether
[learning Python by using Django is a bad idea](http://www.jeffknupp.com/blog/2012/12/11/learning-python-via-django-considered-harmful/).
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><a href="http://www.jeffknupp.com/blog/2012/12/11/learning-python-via-django-considered-harmful/">DjangoでPythonを学ぶな</a>という議論もありますが、Web開発に飛び込む前にPythonの基礎を学んでいれば問題ありません。</p>
<!--## Django tutorials -->
<h2>Djangoチュートリアル</h2>
<!--* [Tango with Django](http://www.tangowithdjango.com/book/) 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.-->
<ul>
<li><a href="http://www.tangowithdjango.com/book/">Tango with Django</a>は無料で読めるDjangoの包括的なガイドです。このガイドがDjangoの学び始めには最も役立ったという人もいます。</li>
</ul>
<!--* [2 Scoops of Django](http://twoscoopspress.com/products/two-scoops-of-django-1-6)
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.-->
<ul>
<li>Daniel GreenfeldとAudrey Royによる<a href="http://twoscoopspress.com/products/two-scoops-of-django-1-6">2 Scoops of Django</a>は、DjangoによるWeb開発を正しく学びたいのなら、購入する価値のある書籍です。</li>
</ul>
<!--* [Effective Django](http://effectivedjango.com/) is another free introduction
to the web framework.-->
<ul>
<li><a href="http://effectivedjango.com/">Effective Django</a>は無料のイントロダクションです。</li>
</ul>
<!--* [Test-Driven Development with Python](http://www.obeythetestinggoat.com/)
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.-->
<ul>
<li><a href="http://www.obeythetestinggoat.com/">Test-Driven Development with Python</a>はDjangoとJavaScriptを使ったWeb開発にフォーカスしています。Djangoを使って実践的なアプリケーションをテスト駆動開発によって開発する方法を学ぶことができます。また、NoSQL、WebSocket、非同期通信についても触れられています。オンラインであれば無料、書籍版はO'Reillyから出版されています。</li>
</ul>
<!--* The [Django subreddit](http://www.reddit.com/r/django) often has links to
the latest resources for learning Django and is also a good spot to ask
questions about it.-->
<ul>
<li><a href="http://www.reddit.com/r/django">Django subreddit</a>では、Djangoを学ぶための最新のリソースが投稿され、質問するにも良い場所でしょう。</li>
</ul>
<!--* Lincoln Loop wrote a
[Django Best Practices guide](http://lincolnloop.com/django-best-practices/)
for the community.-->
<ul>
<li>Lincoln Loopが<a href="http://lincolnloop.com/django-best-practices/">Django Best Practices guide</a>をコミュニティに執筆しています。</li>
</ul>
<!--* Steve Losh wrote an incredibly detailed [Django Advice guide](http://stevelosh.com/blog/2011/06/django-advice/).-->
<ul>
<li>Steve Loshは細部まで素晴らしい<a href="http://stevelosh.com/blog/2011/06/django-advice/">Django Advice guide</a>を執筆しています。</li>
</ul>
<!--* [Lightweight Django](http://programming.oreilly.com/2014/04/simplifying-django.html)
has several nice examples for breaking Django into smaller simplier
components.-->
<ul>
<li><a href="http://programming.oreilly.com/2014/04/simplifying-django.html">Lightweight Django</a>はDjangoをより小さくシンプルなコンポーネントに分割して利用するための方法を学ぶことができます。</li>
</ul>
<!--* The [Definitive Guide to Django Deployment](https://github.com/rogueleaderr/definitive_guide_to_django_deployment)
explains the architecture of the resulting set up and includes Chef scripts
to automate the deployment.-->
<ul>
<li><a href="https://github.com/rogueleaderr/definitive_guide_to_django_deployment">Definitive Guide to Django Deployment</a>はChefを利用したデプロイの自動化を含めた、アプリケーションの構成ガイドです。</li>
</ul>
<!--* [Deploying a Django app on Amazon EC2 instance](http://agiliq.com/blog/2014/08/deploying-a-django-app-on-amazon-ec2-instance/)
is a detailed walkthrough for deploying an example Django app to Amazon
Web Services.-->
<ul>
<li><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>はDjangoアプリケーションをAmazon Web Servicesにデプロイする詳細なチュートリアルです。</li>
</ul>
<!--* This [step-by-step guide for Django](http://aliteralmind.wordpress.com/2014/09/21/jquery_django_tutorial/)
shows how to transmit data via AJAX with JQuery.-->
<ul>
<li><a href="http://aliteralmind.wordpress.com/2014/09/21/jquery_django_tutorial/">step-by-step guide for Django</a>はjQuetyを使ったAjaxによる通信する方法を解説しています。</li>
</ul>
<!--* [Deploying Django on AWS](http://www.nickpolet.com/blog/deploying-django-on-aws/1/)
is another walkthrough for deploying Django to AWS.-->
<ul>
<li><a href="http://www.nickpolet.com/blog/deploying-django-on-aws/1/">Deploying Django on AWS</a>でもDjangoをAWSにデプロイする方法を解説しています。</li>
</ul>
<!--* [django-awesome](https://github.com/rosarior/awesome-django) is a curated
list of Django libraries and resources.-->
<ul>
<li><a href="https://github.com/rosarior/awesome-django">django-awesome</a>では、Djangoに関係するライブラリや資料のリストが紹介されています。</li>
</ul>
<!--* [Starting a Django Project](https://realpython.com/learn/start-django/) answers the question, “How do I set up a Django (1.5, 1.6, or /1.7) project from scratch?”-->
<ul>
<li><a href="https://realpython.com/learn/start-django/">Starting a Django Project</a>ではDjango(v1.5~1.7)によるプロジェクトのセットアップ方法について説明されています。</li>
</ul>
<!--* The [recommended Django project layout](http://www.revsys.com/blog/2014/nov/21/recommended-django-project-layout/)
is helpful for developers new to Django to understand how to structure
the directories and files within apps for projects.-->
<ul>
<li><a href="http://www.revsys.com/blog/2014/nov/21/recommended-django-project-layout/">recommended Django project layout</a>では、初心者向けにDjangoプロジェクト内のアプリケーションにおけるディレクトリ構成を説明しています。</li>
</ul>
<!--* The [Django Request-Response Cycle](http://irisbeta.com/article/245366784/the-django-request-response-cycle/)
explains what happens when you visit a webpage generated by Django.-->
<ul>
<li><a href="http://irisbeta.com/article/245366784/the-django-request-response-cycle/">Django Request-Response Cycle</a>では、Djangoアプリケーションへアクセスした際に内部で何が起こっているのかを説明しています。</li>
</ul>
<!--* [Using Amazon S3 to Store your Django Site's Static and Media Files](http://www.caktusgroup.com/blog/2014/11/10/Using-Amazon-S3-to-store-your-Django-sites-static-and-media-files/)
is a well written guide to a question commonly asked about static and
media file serving.-->
<ul>
<li><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>では、静的ファイルやメディアファイルを配信する方法を詳しく解説しています。</li>
</ul>
<!-- ## Django videos -->
<h2>Djangoのビデオ</h2>
<!--* Kate Heddleston and I gave a talk at DjangoCon 2014 called
[Choose Your Own Django Deployment Adventure](https://www.youtube.com/watch?v=QrFEKghISEI)
which walked through many of the scenarios you'd face when deploying your
first Django website.-->
<p>Kate Heddlestonと著者によるDjangoCon 2014での<a href="https://www.youtube.com/watch?v=QrFEKghISEI">Choose Your Own Django Deployment Adventure</a>では、初めてDjangoアプリケーションをデプロイする際に直面する様々なシナリオについて解説しています。</p>
<!--* [GoDjango](https://godjango.com/) screencasts and tutorials are free short
videos for learning how to build Django applications.-->
<ul>
<li><a href="https://godjango.com/">GoDjango</a>スクリーンキャスト及びチュートリアルでは、Djangoアプリケーションを構築するための短いチュートリアルを無料で観ることができます。</li>
</ul>
<!--* [Getting Started with Django](http://gettingstartedwithdjango.com/) is a
series of video tutorials for the framework.-->
<ul>
<li><a href="http://gettingstartedwithdjango.com/">Getting Started with Django</a>はDjangoのビデオチュートリアルシリーズです。</li>
</ul>
<!--* The videos and slides from
[Django: Under the Hood 2014](http://www.djangounderthehood.com/talks/)
are from Django core commiters and provide insight into the ORM,
internationalization, templates and other topics.-->
<ul>
<li>Djangoの中心的なコミッターによる<a href="http://www.djangounderthehood.com/talks/">Django: Under the Hood 2014</a>のビデオ、スライドはORM、国際化、テンプレートなどの話題について触れられています。</li>
</ul>
<!--* DjangoCon US videos from
[2014](https://www.youtube.com/playlist?list=PLE7tQUdRKcybbNiuhLcc3h6WzmZGVBMr3),
[2013](http://www.youtube.com/user/TheOpenBastion/videos),
[2012](http://pyvideo.org/category/23/djangocon-2012),
[2011](http://pyvideo.org/category/3/djangocon-2011), as well as
[earlier US and DjangoCon EU conferences](http://pyvideo.org/category) are
all available free of charge.-->
<ul>
<li>DjangoCon USのビデオ、<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>、<a href="http://pyvideo.org/category">earlier US and DjangoCon EU conferences</a>は無料で視聴することができます。</li>
</ul>
<!-- ## Django 1.7-specific resources -->
<h2>Django 1.7のリソース</h2>
<!--* Paul Hallett wrote a
[detailed Django 1.7 app upgrade guide](https://www.twilio.com/blog/2014/10/upgrading-your-django-reusable-app-to-support-django-1-7.html)
on the Twilio blog from his experience working with the django-twilio
package.-->
<ul>
<li>TwilioブログでPaul Halleteが投稿した<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>は、django-twilioパッケージを開発した経験に基づいた記事です。</li>
</ul>
<!--* [Designing Django's Migrations](http://pyvideo.org/video/2630/designing-djangos-migrations)
covers Django 1.7's new migrations from the main programmer
of South and now Django's built-in migrations, Andrew Godwin.-->
<ul>
<li><a href="http://pyvideo.org/video/2630/designing-djangos-migrations">Designing Django's Migrations</a>では、South及び、Djangoに組み込まれたマイグレーションツールのメイン開発者であるAndrew GodwinがDjango 1.7の新しいマイグレーションについて解説しています。</li>
</ul>
<!--* Real Python's [migrations primer](https://realpython.com/blog/python/django-migrations-a-primer/)
explores the difference between South's migrations and the built-in
Django 1.7 migrations as well as how you use them.-->
<ul>
<li>Real Pythonの<a href="https://realpython.com/blog/python/django-migrations-a-primer/">migrations primer</a>では、Southによるマイグレーションと、Django 1.7のマイグレーションの違いについて解説しています。</li>
</ul>
<!--* 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.
[Part 1](http://andrewsforge.com/article/upgrading-django-to-17/part-1-introduction-and-django-releases/),
[part 2](http://andrewsforge.com/article/upgrading-django-to-17/part-2-migrations-in-django-16-and-17/) and
[part 3](http://andrewsforge.com/article/upgrading-django-to-17/part-3-django-17-new-features/)
and
[part 4](http://andrewsforge.com/article/upgrading-django-to-17/part-4-upgrade-strategies/)
are now all available to read.-->
<ul>
<li>Andrew Pinkhamによる"Upgrading to Django 1.7"シリーズは、Djangoの新しい機能について、そしてそれを利用する方法を学ぶことができます。<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>、<a href="http://andrewsforge.com/article/upgrading-django-to-17/part-3-django-17-new-features/">part 3</a>、<a href="http://andrewsforge.com/article/upgrading-django-to-17/part-4-upgrade-strategies/">part 4</a>を読むことができるようになっています。</li>
</ul>
<!-- ## Django with Angular (Djangular) resources -->
<h2>DjangoとAngularJS(Djangular)のリソース</h2>
<!-- * [Getting Started with Django Rest Framework and AngularJS](http://blog.kevinastone.com/getting-started-with-django-rest-framework-and-angularjs.html)
is a very detailed introduction to Djangular with example code. -->
<ul>
<li><a href="http://blog.kevinastone.com/getting-started-with-django-rest-framework-and-angularjs.html">Getting Started with Django Rest Framework and AngularJS</a>は、サンプルコードを交えたDjangularの詳しいイントロダクションです。</li>
</ul>
<!-- * [Building Web Applications with Django and AngularJS](https://thinkster.io/brewer/angular-django-tutorial/)
is a very detailed guide for using Django as an API layer and AngularJS
as the MVC front end in the browser. -->
<ul>
<li><a href="https://thinkster.io/brewer/angular-django-tutorial/">Building Web Applications with Django and AngularJS</a>は、DjangoをAPIレイヤーとして、AngularJSをクライアントサイドMVCとして利用するための詳細なガイドです。</li>
</ul>
<!-- * This [end to end web app with Django-Rest-Framework & AngularJS part 1](http://blog.mourafiq.com/post/55034504632/end-to-end-web-app-with-django-rest-framework)
tutorial along with
[part 2](http://blog.mourafiq.com/post/55099429431/end-to-end-web-app-with-django-rest-framework),
[part 3](http://blog.mourafiq.com/post/58725341511/end-to-end-web-app-with-django-rest-framework)
and
[part 4](http://blog.mourafiq.com/post/58726121556/end-to-end-web-app-with-django-rest-framework)
creates an example blog application with Djangular. There is also a
corresponding [GitHub repo](https://github.com/mouradmourafiq/django-angular-blog)
for the project code. -->
<ul>
<li><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>、及び<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>、<a href="http://blog.mourafiq.com/post/58726121556/end-to-end-web-app-with-django-rest-framework">part 4</a>はDjangularでブログアプリケーションを作るチュートリアルです。コードは<a href="https://github.com/mouradmourafiq/django-angular-blog">GitHub</a>でホストされています。</li>
</ul>
<!-- ## Django ORM resources -->
<h2>Django ORMのリソース</h2>
<!-- The [Django ORM](https://docs.djangoproject.com/en/dev/topics/db/) 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 [SQLAlchemy](http://www.sqlalchemy.org/). -->
<p><a href="https://docs.djangoproject.com/en/dev/topics/db/">Django ORM</a>はシンプル、またはやや複雑なデータベースの操作に適しています。場合によってORMを使うことで直接SQLを書くよりも複雑になってしまい、<a href="http://www.sqlalchemy.org/">SQLAlchemy</a>を使う方法もあります。</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>SQLを直接記述することは、技術的に可能ではありますがデータベースの実装によってクエリを書き分けなければなりません。ORMはDjangoと密接につながっているので、デフォルトのORMをSQLAlchemyに置き換えるためにはDjangoをハックしなければなりません。ただDjangoのコアコミッターたちはデフォルトのORMがSQLAlchemyに置き換わるのは時間の問題だと考えています。彼らの素晴らしい仕事によりDjango 1.9、またはそれ以降のバージョンで実現するかもしれません。</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>大部分のDjangoプロジェクトではデフォルトのORMが利用されているので、現在のフレームワークでの応用的な利用方法やツールに関する資料を読んでおきましょう。</p>
<!-- * [Django models, encapsulation and data integrity](http://www.dabapps.com/blog/django-models-and-encapsulation/)
is a detailed article by Tom Christie on encapsulating Django models for
data integrity. -->
<ul>
<li><a href="http://www.dabapps.com/blog/django-models-and-encapsulation/">Django models, encapsulation and data integrity</a>はTom Christieによる、モデルのデータ完全性をカプセル化する方法を詳細に解説しています。</li>
</ul>
<!-- * [Django Debug Toolbar](http://django-debug-toolbar.readthedocs.org/en/1.2/)
is a powerful Django ORM database query inspection tool. Highly recommended
during development to ensure you're writing reasonable query code.
[Django Silk](http://mtford.co.uk/blog/2/) is another inspection tool and
has capabilities to do more than just SQL inspection. -->
<ul>
<li><a href="http://django-debug-toolbar.readthedocs.org/en/1.2/">Django Debug Toolbar</a>はDjango ORMのデータベースクエリをデバッグするための強力なツールです。開発中は適切なクエリを書いていることを確認することを強くお勧めします。<a href="http://mtford.co.uk/blog/2/">Django Silk</a>のようなSQLだけにとどまらないデバッグツールもあります。 </li>
</ul>
<!-- * [Making a specific Django app faster](http://reinout.vanrees.org/weblog/2014/05/06/making-faster.html)
is a Django performance blog post with some tips on measuring performance
and optimizing based on the measured results. -->
<ul>
<li><a href="http://reinout.vanrees.org/weblog/2014/05/06/making-faster.html">Making a specific Django app faster</a>はパフォーマンスの計測と最適化について解説されているポストです。</li>
</ul>
<!-- * [Why I Hate the Django ORM](https://speakerdeck.com/alex/why-i-hate-the-django-orm)
is Alex Gaynor's overview of the bad designs decisions, some of which he
made, while building the Django ORM. -->
<ul>
<li><a href="https://speakerdeck.com/alex/why-i-hate-the-django-orm">Why I Hate the Django ORM</a>はAlex GaynorによるDjango ORM開発中の悪い設計について語られています。</li>
</ul>
<!-- * [Going Beyond Django ORM with Postgres](https://speakerdeck.com/craigkerstiens/going-beyond-django-orm-with-postgres)
is specific to using PostgreSQL with Django. -->
<ul>
<li><a href="https://speakerdeck.com/craigkerstiens/going-beyond-django-orm-with-postgres">Going Beyond Django ORM with Postgres</a>ではDjangoとPostgreSQLを利用する方法が解説されています。</li>
</ul>
<!-- * [Migrating a Django app from MySQL to PostgreSQL](http://www.calazan.com/migrating-django-app-from-mysql-to-postgresql/)
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. -->
<ul>
<li><a href="http://www.calazan.com/migrating-django-app-from-mysql-to-postgresql/">Migrating a Django app from MySQL to PostgreSQL</a>ではMySQLからPostgreSQLに移行する方法が解説されています。しかし、著者個人の意見としては、すでに運用中のDjangoアプリケーションのデータベースを他のバックエンドに移行するのはORMのちからを借りても困難だと考えています。</li>
</ul>
<!-- * [Django Model Descriptors](http://blog.kevinastone.com/django-model-descriptors.html)
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. -->
<ul>
<li><a href="http://blog.kevinastone.com/django-model-descriptors.html">Django Model Descriptors</a>では、ビジネスロジックをモデルに取り込みビューの複雑化を回避する方法、そして各ビュー間で再利用する方法について検討しています。</li>
</ul>
<!-- ## Open source Django example projects -->
<h2>オープンソースのサンプルプロジェクト</h2>
<!-- * [Txt 2 React](https://github.com/makaimc/txt2react) is a full Django web
app that allows audiences to text in during a presentation with feedback
or questions. -->
<ul>
<li><a href="https://github.com/makaimc/txt2react">Txt 2 React</a>は、プレゼンテーション中に視聴者がフィードバックや質問を書き込めるアプリケーションです。</li>
</ul>
<!-- * [Openduty](https://github.com/ustream/openduty) is a website status checking
and alert system similar to PagerDuty. -->
<ul>
<li><a href="https://github.com/ustream/openduty">Openduty</a>はPagerDutyに似たウェブサイトのステータス確認、及び監視システムです。</li>
</ul>
<!-- * [Courtside](https://github.com/myusuf3/courtside) is a pick up sports web
application written and maintained by the author of PyCoder's Weekly. -->
<ul>
<li><a href="https://github.com/myusuf3/courtside">Courtside</a>はPyCoder's Weeklyの作者によって開発された、スポーツイベントを探すためのアプリケーションです。</li>
</ul>
<!-- * These two Django Interactive Voice Response (IVR) system web application
repositorities [part 1](https://github.com/phalt/twilio-django-part-1) and
[part 2](https://github.com/phalt/twilio-django-part-2) show you how to
build a really cool Django application. There's also an accompanying
[blog post](https://www.twilio.com/blog/2014/07/build-an-ivr-system-with-twilio-and-django.html)
with detailed explanations of each step. -->
<ul>
<li>Djangoで作られた音声による自動応答システムのレポジトリです。<a href="https://github.com/phalt/twilio-django-part-1">part 1</a>と<a href="https://github.com/phalt/twilio-django-part-2">part 2</a>に分けられています。<a href="https://www.twilio.com/blog/2014/07/build-an-ivr-system-with-twilio-and-django.html">blog post</a>で詳細に解説されています。</li>
</ul>
<!-- ## Django project templates -->
<h2>Djangoプレジェクトのテンプレート</h2>
<!-- * [Caktus Group's Django project template](https://github.com/caktus/django-project-template)
is Django 1.6+ ready. -->
<ul>
<li><a href="https://github.com/caktus/django-project-template">Caktus Group's Django project template</a>はDjango1.6以降で利用できるプロジェクトのテンプレートです。</li>
</ul>
<!-- * [Cookiecutter Django](https://github.com/pydanny/cookiecutter-django) is a
project template from Daniel Greenfeld, for use with Audrey Roy's
[Cookiecutter](https://github.com/audreyr/cookiecutter). Heroku
deployment-ready. -->
<ul>
<li><a href="https://github.com/pydanny/cookiecutter-django">Cookiecutter Django</a>はDaniel Greenfeldによるプロジェクトのテンプレートで、Audrey Royの<a href="https://github.com/audreyr/cookiecutter">Cookiecutter</a>で利用されています。Herokuにデプロイすることができます。</li>
</ul>
<!-- * [Two Scoops Django project template](https://github.com/twoscoops/django-twoscoops-project)
is also from the PyDanny and Audrey Roy. This one provides a quick scaffold
described in the Two Scoops of Django book. -->
<ul>
<li><a href="https://github.com/twoscoops/django-twoscoops-project">Two Scoops Django project template</a>もPyDannyとAudrey Royによる、プロジェクトテンプレートです。Two Scoopsの書籍で説明されている構成を素早く組み上げることができます。</li>
</ul>
<!-- ## Django learning checklist -->
<h2>Djangoを学ぶためのチェックリスト</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. -->
あなたの開発マシンに<a href="https://docs.djangoproject.com/en/dev/topics/install/">Djangoをインストール</a>しましょう。</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>. -->
<a href="https://docs.djangoproject.com/en/dev/intro/tutorial01/">"polls"チュートリアル</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. -->
Djangoのリソースにリストされているチュートリアルで学んだ知識を使って、シンプルなアプリケーションをいくつか作ってみましょう。</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. -->
<a href="https://docs.djangoproject.com/en/dev/">公式ドキュメント</a>や以下のリンクを読んで、自分のDjangoプロジェクトを書き始めましょう。アプリケーションを正しく構築する方法を学ぶ上で重要となる、失敗をたくさんすると思います。</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. -->
<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> を読んで、Djangoのベストプラクティスと、Djangoでアプリケーションを作るためのより良い方法を理解してください。</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. -->
<a href="./deployment.html">デプロイの章</a>に進み、あなたのDjangoプロジェクトを公開しましょう。</p>
<!-- ### What do you need to learn next for your Django app? -->
<h3>Djangoアプリケーションの次に学ぶことは?</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="highlight"><pre><span class="kn">from</span> <span class="nn">flask</span> <span class="kn">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="nd">@app.route</span><span class="p">(</span><span class="s">'/'</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">hello_world</span><span class="p">():</span>
<span class="k">return</span> <span class="s">'Hello World!'</span>
<span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">'__main__'</span><span class="p">:</span>
<span class="n">app</span><span class="o">.</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><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>
</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>
</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. -->
<a href="http://bottlepy.org/docs/dev/index.html">Bottle</a>はWSGI互換の<a href="https://github.com/defnull/bottle/blob/master/bottle.py">シングルファイル</a>のWebフレームワークで、Pythonの標準ライブラリだけで動作します。</p>
<!-- ## Bottle resources -->
<h2>Bottleのリソース</h2>
<!-- * The [official Bottle tutorial](http://bottlepy.org/docs/dev/tutorial.html)
provides a thorough view of basic concepts and features for the framework. -->
<ul>
<li><a href="http://bottlepy.org/docs/dev/tutorial.html">公式チュートリアル</a>では、基本的なコンセプトと機能を解説しています。</li>
</ul>
<!-- * Digital Ocean provides an extensive [introductory post on Bottle](https://www.digitalocean.com/community/articles/how-to-use-the-bottle-micro-framework-to-develop-python-web-apps). -->
<ul>
<li>Digital Oceanに<a href="https://www.digitalocean.com/community/articles/how-to-use-the-bottle-micro-framework-to-develop-python-web-apps">Bottleの入門記事</a>が掲載されています。</li>
</ul>
<!-- * This tutorial provides a walkthrough for
[getting started with Bottle](http://www.giantflyingsaucer.com/blog/?p=3598). -->
<ul>
<li><a href="http://www.giantflyingsaucer.com/blog/?p=3598">getting started with Bottle</a>はBottleの入門記事です。</li>
</ul>
<!-- * Here's a short code snippet for
[creating a RESTful API with Bottle and MongoDB](http://myadventuresincoding.wordpress.com/2011/01/02/creating-a-rest-api-in-python-using-bottle-and-mongodb/). -->
<ul>
<li><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>では、Bottleアプリケーションのサンプルコードを読むことができます。</li>
</ul>
<!-- * This [tutorial](http://gotofritz.net/blog/weekly-challenge/restful-python-api-bottle/)
is another Bottle walkthrough for creating a RESTful web API. -->
<ul>
<li>この<a href="http://gotofritz.net/blog/weekly-challenge/restful-python-api-bottle/">チュートリアル</a>でもBottleを使ったRESTful APIの作り方が解説されています。</li>
</ul>
<!-- * [BAM! A Web Framework "Short Stack"](http://reachtim.com/articles/BAM-Short-Stack.html)
is a walkthrough of using Bottle, Apache and MongoDB to create a web
application. -->
<ul>
<li><a href="http://reachtim.com/articles/BAM-Short-Stack.html">BAM! A Web Framework "Short Stack"</a>はBottle、Apache、MongoDBを使ったWebアプリケーションのチュートリアルです。</li>
</ul>
<!-- * [Decanter](http://gengo.github.io/decanter/) is a library for structuring
Bottle projects. -->
<ul>
<li><a href="http://gengo.github.io/decanter/">Decanter</a>はBottleプロジェクトを構造化するためのライブラリです。</li>
</ul>
<!-- ## Open source Bottle example projects -->
<h2>オープンソースのサンプルプロジェクト</h2>
<p><!-- * <a href="https://github.com/thekad/pasttle">Pattle</a> is a pastebin clone built with
Bottle. -->
* <a href="https://github.com/thekad/pasttle">Pattle</a>はpastbinクローンです。</p>
<!-- ## Bottle framework learning checklist -->
<h2>Bottleフレームワークを学ぶためのチェックリスト</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. -->
<a href="https://github.com/defnull/bottle/raw/master/bottle.py">Bottleをダウンロード</a>するか、<code>pip install bottle</code>でローカルマシンにインストールしてください。</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>. -->
公式の<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. -->
公式チュートリアルとオープンソースのサンプルプロジェクトで学んだ知識を元にあなたのBottleプロジェクトを始めてください。</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. -->
Bottleアプリケーションを公開するために<a href="./deployment.html">デプロイの章</a>に進んでください。</p>
<!-- ### What do you need to learn next? -->
<h3>次は何を学びますか?</h3>
<!-- # Other Web Frameworks -->
<h1>その他のWebフレームワーク</h1>
<p><!-- Python has a significant number of web frameworks outside the usual Django,
Flask and Bottle suspects. -->
PythonにはDjango、Flask、Bottle以外にも様々なWebフレームワークがあります。</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. -->
<a href="http://www.pylonsproject.org/">Pyramid framework</a>は様々なWebフレームワークを開発してきたPylonsプロジェクトから始まったフレームワークです。PyramidアプリケーションはMVCアーキテクチャを使って構成されます。</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. -->
<a href="http://www.turbogears.org">TurboGears2</a>はPylonsプロジェクトからなるフルスタックレイヤーとして誕生し、現在では、Djangoのようなフルスタックフレームワークとしても、マイクロフレームワークとしても利用可能な、単独のフレームワークになっています。</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. -->
<a href="http://falconframework.org/">Falcon</a>はパフォーマンスの高さを意識して作られているミニマルなWebフレームワークです。</p>
<h2>Morepath</h2>
<p><!-- <a href="http://morepath.readthedocs.org/en/latest/">Morepath</a> is a micro web
framework that routes URLs directly to model code. -->
<a href="http://morepath.readthedocs.org/en/latest/">Morepath</a>はURLを直接Modelにひもづけることができるマイクロフレームワークです。</p>
<!-- * Morepath's creator gave a
[great talk on the motivation and structure for the new framework](https://www.youtube.com/watch?v=gyDKMAWPyuY)
at EuroPython 2014. -->
<ul>
<li>Morepathの開発者はEuroPython 2014で、新しいフレームワークのモチベーションと構造について素晴らしい<a href="https://www.youtube.com/watch?v=gyDKMAWPyuY">プレゼンテーション</a>を行っています。</li>
</ul>
<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. -->
<a href="http://webpy.org/">web.py</a>はシンプルにWebアプリケーションを作成できるように設計されたPythonのWebフレームワークです。</p>
<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. -->
<a href="http://www.web2py.com/">Web2py</a>はMVC形式の「電池付属」なフレームワークです。</p>
<!-- ## Other web framework resources -->
<h2>その他Webフレームワークのリソース</h2>
<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. -->
* <a href="http://codecondo.com/14-minimal-web-frameworks-for-python/">roundup of 14 minimal Python frameworks</a>は有名、無名を含むPythonフレームワークのまとめです。</p>
<!-- * The [web micro-framework battle](http://www.slideshare.net/r1chardj0n3s/web-microframework-battle/)
presentation goes over Bottle, Flask, and many other lesser known Python
web frameworks. -->
<ul>
<li><a href="http://www.slideshare.net/r1chardj0n3s/web-microframework-battle/">web micro-framework battle</a>はBottle、Flaskとその他のPython Web Frameworkを比較しています。</li>
</ul>
<!-- * A Python newcomer asked the Python Subreddit to
[explain the differences between numerous Python web frameworks](http://www.reddit.com/r/Python/comments/28qr7c/can_anyone_explain_the_differences_between_web2py/)
and received some interesting responses from other users. -->
<ul>
<li>Pythonの初学者が<a href="http://www.reddit.com/r/Python/comments/28qr7c/can_anyone_explain_the_differences_between_web2py/">PythonのWebフレームワークの違い</a>について質問しており、興味深い回答が寄せられています。</li>
</ul>
<!-- ## Other frameworks learning checklist -->
<h2>その他フレームワークを学ぶためのチェックリスト</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. -->
DjangoやFlask以外のWebフレームワークが存在していることを知っておくのは役立つことです。しかし、あなたが初学者の場合、<a href="./django.html">Django</a>や<a href="./flask.html">Flask</a>に関するチュートリアルや資料のほうが多いため、まずはこの2つのフレームワークのどちらかを深く利用できるように成るべきでしょう。</p>