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
What's New in Django 1.9
Search
Baptiste Mispelon
October 28, 2015
Technology
1
200
What's New in Django 1.9
Baptiste Mispelon
October 28, 2015
Tweet
Share
More Decks by Baptiste Mispelon
See All by Baptiste Mispelon
Jezdezcon - Stickers vs Buttons
bmispelon
0
99
Baptiste's adventures in Djangoland
bmispelon
0
1.5k
London Django Sprint Intro
bmispelon
0
940
Budapest.py January 2015 Intro
bmispelon
0
76
Announcing: Django Under the Hood
bmispelon
1
170
Stdlib Safari - Exotic Animal Edition
bmispelon
2
220
Tales From the Django Circus
bmispelon
0
220
Other Decks in Technology
See All in Technology
CREがSLOを握ると 何が変わるのか
nekomaho
0
180
GitHub Copilot CLI で Azure Portal to Bicep
tsubakimoto_s
0
290
「通るまでRe-run」から卒業!落ちないテストを書く勘所
asumikam
3
840
ADK + Gemini Enterprise で 外部 API 連携エージェント作るなら OAuth の仕組みを理解しておこう
kaz1437
0
230
JEDAI認定プログラム JEDAI Order 2026 受賞者一覧 / JEDAI Order 2026 Winners
databricksjapan
0
400
「AIエージェントで変わる開発プロセス―レビューボトルネックからの脱却」
lycorptech_jp
PRO
0
180
Oracle Cloud Infrastructure(OCI):Onboarding Session(はじめてのOCI/Oracle Supportご利⽤ガイド)
oracle4engineer
PRO
2
17k
非同期・イベント駆動処理の分散トレーシングの繋げ方
ichikawaken
1
200
FASTでAIエージェントを作りまくろう!
yukiogawa
4
160
AI時代のシステム開発者の仕事_20260328
sengtor
0
310
Oracle Cloud Infrastructure:2026年3月度サービス・アップデート
oracle4engineer
PRO
0
160
OCI技術資料 : ロード・バランサ 概要 - FLB・NLB共通
ocise
4
27k
Featured
See All Featured
Mind Mapping
helmedeiros
PRO
1
130
My Coaching Mixtape
mlcsv
0
87
A better future with KSS
kneath
240
18k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
199
73k
Building the Perfect Custom Keyboard
takai
2
720
Information Architects: The Missing Link in Design Systems
soysaucechin
0
850
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.5k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
140
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
290
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
230
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
Building an army of robots
kneath
306
46k
Transcript
What’s New in Django 1.9?
Hi!
Baptiste Mispelon
Django 1.9
Python Support
pip install Django==1.9b1
What’s new?
Major New Features
transaction.on_commit
from django.db import transaction with transaction.atomic(): transaction.on_commit(send_email) do_some_database_stuff()
AUTH_PASSWORD_VALIDATORS
from django.contrib.auth.password_validation import ( UserAttributeSimilarityValidator, MinimumLengthValidator, CommonPasswordValidator, NumericPasswordValidator, )
contrib.auth.mixins
from django.contrib.auth.mixins import ( AccessMixin, LoginRequiredMixin, PermissionRequiredMixin, UserPassesTestMixin, )
New Admin Theme
None
None
None
None
New Admin Theme
Can’t Upgrade Yet? pip install django-flat-theme
./manage.py test --parallel
Random Minor Features
contrib.postgres.JSONField
from django.contrib.postgres.fields import JSONField from django.db import models class Dog(models.Model):
name = models.CharField(max_length=200) data = JSONField()
Dog.objects.create(name='Rufus', data={ 'breed': 'labrador', 'owner': {'name': 'Bob'}, })
Dog.objects.filter( data__breed='collie' )
Dog.objects.filter( data__owner__name='Bob' )
db.backends.postgresql
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
} }
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
} }
Which One?
Which One?
CharField.strip
from django import forms class NameForm(forms.Form): name = forms.CharField()
f = NameForm({ ‘name’: ‘ Baptiste ‘, })
f = NameForm({ ‘name’: ‘ Baptiste ‘, })
>>> f.is_valid() True >>> f.cleaned_data[‘name’] ‘Baptiste’
Field.disabled
from django import forms class PersonForm(forms.Form): name = forms.CharField() age
= forms.IntegerField(disabled=True)
f = PersonForm( initial={‘age’: 30}, data={‘name’: ‘Baptiste’, ‘age’: 12}, )
>>> f.is_valid() True >>> f.cleaned_data[‘age’] 30
./manage.py sendtestemail
./manage.py dumpdata --output
python -m django
django-admin.py startproject foo python -m django startproject foo
--no-input
filter(pub_date__month__gt=6)
from django.db import models class Post(models.Model): title = models.CharField(max_length=100) pub_date
= models.DateTimeField()
Post.objects.filter(pub_date__lt=timezone.now()) Post.objects.filter(pub_date__year=2015) Post.objects.filter(pub_date__year__lte=2014)
What’s Next?
What’s Next?
Thanks!