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.6k
Yes We Did: Reelecting Obama.
dryan
1
450
5 Ways to Embrace HTML5 Today
dryan
5
230
CSS3: Possibilities, Best Practices and Pitfalls
dryan
1
130
CSS for Mobile
dryan
2
180
Other Decks in Technology
See All in Technology
なぜAWSを活かしきれないのか?技術と組織への処方箋
nrinetcom
PRO
1
240
AI駆動開発を推進するためにサービス開発チームで 取り組んでいること
noayaoshiro
0
240
OpenAI gpt-oss ファインチューニング入門
kmotohas
2
1.1k
『バイトル』CTOが語る! AIネイティブ世代と切り拓くモノづくり組織
dip_tech
PRO
1
110
生成AIで「お客様の声」を ストーリーに変える 新潮流「Generative ETL」
ishikawa_satoru
1
370
Wasmのエコシステムを使った ツール作成方法
askua
0
110
後進育成のしくじり〜任せるスキルとリーダーシップの両立〜
matsu0228
7
3.2k
ガバメントクラウド(AWS)へのデータ移行戦略の立て方【虎の巻】 / 20251011 Mitsutosi Matsuo
shift_evolve
PRO
2
180
20201008_ファインディ_品質意識を育てる役目は人かAIか___2_.pdf
findy_eventslides
2
590
PLaMo2シリーズのvLLM実装 / PFN LLM セミナー
pfn
PRO
2
1.1k
Shirankedo NOCで見えてきたeduroam/OpenRoaming運用ノウハウと課題 - BAKUCHIKU BANBAN #2
marokiki
0
170
空間を設計する力を考える / 20251004 Naoki Takahashi
shift_evolve
PRO
4
450
Featured
See All Featured
The Invisible Side of Design
smashingmag
301
51k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
BBQ
matthewcrist
89
9.8k
Building an army of robots
kneath
306
46k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
The Power of CSS Pseudo Elements
geoffreycrofte
79
6k
Building Adaptive Systems
keathley
43
2.8k
Making the Leap to Tech Lead
cromwellryan
135
9.6k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
How STYLIGHT went responsive
nonsquared
100
5.8k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.7k
The Cost Of JavaScript in 2023
addyosmani
53
9k
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 • • • •
•