Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Developing with Django
Search
Daniel Ryan
October 22, 2011
Technology
2
310
Developing with Django
A "get started" guide to Django powered websites.
Daniel Ryan
October 22, 2011
Tweet
Share
More Decks by Daniel Ryan
See All by Daniel Ryan
Human-first Web Design
dryan
11
2.5k
Yes We Did: Reelecting Obama.
dryan
1
410
5 Ways to Embrace HTML5 Today
dryan
5
230
CSS3: Possibilities, Best Practices and Pitfalls
dryan
1
130
CSS for Mobile
dryan
2
170
Other Decks in Technology
See All in Technology
小学3年生夏休みの自由研究「夏休みに Copilot で遊んでみた」
taichinakamura
0
160
AI時代のデータセンターネットワーク
lycorptech_jp
PRO
1
290
普通のエンジニアがLaravelコアチームメンバーになるまで
avosalmon
0
100
成果を出しながら成長する、アウトプット駆動のキャッチアップ術 / Output-driven catch-up techniques to grow while producing results
aiandrox
0
350
Oracle Cloud Infrastructure:2024年12月度サービス・アップデート
oracle4engineer
PRO
0
190
事業貢献を考えるための技術改善の目標設計と改善実績 / Targeted design of technical improvements to consider business contribution and improvement performance
oomatomo
0
100
新機能VPCリソースエンドポイント機能検証から得られた考察
duelist2020jp
0
220
ガバメントクラウドのセキュリティ対策事例について
fujisawaryohei
0
550
レンジャーシステムズ | 会社紹介(採用ピッチ)
rssytems
0
150
権威ドキュメントで振り返る2024 #年忘れセキュリティ2024
hirotomotaguchi
2
750
DUSt3R, MASt3R, MASt3R-SfM にみる3D基盤モデル
spatial_ai_network
2
170
統計データで2024年の クラウド・インフラ動向を眺める
ysknsid25
2
850
Featured
See All Featured
Site-Speed That Sticks
csswizardry
2
190
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Why Our Code Smells
bkeepers
PRO
335
57k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Typedesign – Prime Four
hannesfritz
40
2.4k
It's Worth the Effort
3n
183
28k
Unsuck your backbone
ammeep
669
57k
Statistics for Hackers
jakevdp
796
220k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
247
1.3M
Making Projects Easy
brettharned
116
5.9k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
Transcript
Developing with Django Daniel Ryan http://dryan.com
Some Background Lawrence Journal-World Ellington Pycon 2005 • • •
Sites Powered by Django
Acronyms Abound MTV - Model • Template • View DRY
- Don’t Repeat Yourself ORM - Object-relational Mapping • • •
MTV vs. MVC Model = Model Template = View View
= Controller • • •
Installing Django Check out http://dryan.com/articles/snow-leopard-64bit- mamp/#python Python Trunk versus Stable
Release Third Party Libraries • • • •
A Django Workflow Create a project Configure settings.py Configure urls.py
Create the database tables • • • •
A Django Workflow Create an app Define your models Create
the database tables Define your urls Define your views • • • • •
Reduce, Reuse, Recycle direct_to_template redirect_to archive_index archive_year archive_month archive_week archive_day
archive_today object_detail (date based) object_list object_detail (list based) create_object update_object delete_object Django Generic Views
Django Templates Just like PHP, except the exact opposite True
separation of logic and presentation Global templates vs. app templates Blocks Tags • • • • •
Built-in Tags autoescape block comment cycle debug extends filter firstof
for for ... empty if ifchanged ifequal ifnotequal include load now regroup spaceless ssi templatetag url widthratio with
Built-in Filters add addslashes capfirst center cut date default default_if_none
dictsort dictsortreversed escapejs filesizeformat first fix_ampersands floatformat force_escape get_digit iriencode join last length_is linebreaks linebreaksbr linenumbers ljust lower make_list phone2numeric pluralize pprint removetags rjust safe safeseq slice slugify stringformat striptags time timesince title truncatewords truncatewords_html unordered_list upper urlencode urlize urlizetrunc wordcount wordwrap
Other Freebies Admin site Authentication Cache system Conditional content processing
Comments Content types Cross Site Request Forgery protection Databrowse E-mail (sending) Flatpages Humanize Internationalization Jython support “Local flavor” Pagination Redirects Serialization Sessions Signals Sitemaps Sites Syndication feeds (RSS/Atom) Unicode in Django Web design helpers django.contrib
Resources http://docs.djangoproject.com irc://irc.freenode.net/django http://thisweekindjango.com/ http://www.djangosnippets.org/ http://code.djangoproject.com/wiki/Tutorials • • • •
•