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
Introduction to Django
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Mahdi Yusuf
May 21, 2015
Programming
530
1
Share
Introduction to Django
Small talk I did for our local Python Group!
Mahdi Yusuf
May 21, 2015
More Decks by Mahdi Yusuf
See All by Mahdi Yusuf
Eight Fallacies of Distributed Systems
myusuf3
0
67
Better Health Insights by Unlocking Data
myusuf3
0
120
Optimizing Your Life
myusuf3
1
160
How To Make Friends and Influence Developers
myusuf3
3
1.2k
Twisted History of Python Packaging
myusuf3
11
15k
Other Decks in Programming
See All in Programming
ふりがな Deep Dive try! Swift Tokyo 2026
watura
0
190
Reactive ❤️ Loom: A Forbidden Love Story
franz1981
2
230
Codex CLIのSubagentsによる並列API実装 / Parallel API Implementation with Codex CLI Subagents
takatty
2
890
アクセシビリティ試験の"その後"を仕組み化する
yuuumiravy
0
120
Symfonyの特性(設計思想)を手軽に活かす特性(trait)
ickx
0
130
GNU Makeの使い方 / How to use GNU Make
kaityo256
PRO
16
5.6k
Rethinking API Platform Filters
vinceamstoutz
0
11k
Nuxt Server Components
wattanx
0
270
存在論的プログラミング: 時間と存在を記述する
koriym
5
860
仕様漏れ実装漏れをなくすトレーサビリティAI基盤のご紹介
orgachem
PRO
9
5.6k
「速くなった気がする」をデータで疑う
senleaf24
0
170
Vibe하게 만드는 Flutter GenUI App With ADK , 박제창, BWAI Incheon 2026
itsmedreamwalker
0
550
Featured
See All Featured
It's Worth the Effort
3n
188
29k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
380
Evolving SEO for Evolving Search Engines
ryanjones
0
180
The agentic SEO stack - context over prompts
schlessera
0
740
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Technical Leadership for Architectural Decision Making
baasie
3
320
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
520
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
230
Paper Plane
katiecoart
PRO
1
49k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
160
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
150
Bash Introduction
62gerente
615
210k
Transcript
Introduction to Django @myusuf3 because who reads documentation
What is Django? The D is silent.
BlogIt The future of online writing, maybe.
$ django-admin startproject blogit blogit ├── blogit │ ├── __init__.py
│ ├── settings.py │ ├── urls.py │ └── wsgi.py └── manage.py
$ django-admin startapp blog * be sure to add new
app in settings file
from django.db import models class Author(models.Model): name = models.CharField(max_length=50) class
Blog(models.Model): title = models.CharField(max_length=200) text = models.TextField() pub_date = models.DateTimeField('date published', auto_now_add=True,) author = models.ForeignKey(Author)
$ python manage.py makemigrations blog
Migrations for 'blog': 0001_initial.py: - Create model Author - Create
model Blog
$ python manage.py migrate
Operations to perform: Synchronize unmigrated apps: staticfiles, messages Apply all
migrations: admin, blog, contenttypes, auth, sessions Synchronizing apps without migrations: Creating tables... Running deferred SQL... Installing custom SQL... Running migrations: Rendering model states... DONE Applying blog.0001_initial... OK
View from Top The steward of control
def post(request, post_id): post = get_object_or_404(Blog, pk=post_id) return render(request, 'post.html',
{'post': post})
Templates and Rendering Making things look beautiful
<h1>{{ post.title }}</h1> <h4> Posted: {{ post.pub_date }}</h4> <h4>Author: {{post.author.name}}</h4>
<p> {{post.text}} </p>
Feature Request! CEO has epiphany!!
def latest(request): posts = Blog.objects.all() return render(request, 'posts.html', {'posts': posts})
{% for post in posts %} <h1>{{ post.title }}</h1> <h4>
Posted: {{ post.pub_date }}</h4> <h4>Author: {{post.author.name}}</h4> <p> {{post.text}} </p> {% endfor %}
Requirements Got a list checking it twice!
dj-database-url==0.3.0 dj-static==0.0.6 Django==1.8 gevent==1.0.1 greenlet==0.4.5 gunicorn==19.3.0 honcho==0.6.6 psycopg2==2.6 static3==0.5.1 static==1.1.1
What is Deploying? The D isn’t silent, just like in
the word difficult.
Inquiries? @myusuf3 Do something magical now!