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
200
1
Share
What's New in Django 1.9
Baptiste Mispelon
October 28, 2015
More Decks by Baptiste Mispelon
See All by Baptiste Mispelon
Jezdezcon - Stickers vs Buttons
bmispelon
0
100
Baptiste's adventures in Djangoland
bmispelon
0
1.6k
London Django Sprint Intro
bmispelon
0
940
Budapest.py January 2015 Intro
bmispelon
0
80
Announcing: Django Under the Hood
bmispelon
1
170
Stdlib Safari - Exotic Animal Edition
bmispelon
2
230
Tales From the Django Circus
bmispelon
0
220
Other Decks in Technology
See All in Technology
[OAWTT26][THR1028] Oracle AI Database 26ai へのアップグレード:ベストプラクティスと最新情報
oracle4engineer
PRO
1
110
社内エンジニア勉強会の醍醐味と苦しみ/tamadev
nishiuma
0
210
目的ファーストのハーネス設計 ~ハーネスの変更容易性を高めるための優先順位~
gotalab555
8
2.2k
生成AIが変える SaaS の競争原理と弁護士ドットコムのプロダクト戦略
bengo4com
0
710
AIでAIをテストする - 音声AIエージェントの品質保証戦略
morix1500
1
120
Rebirth of Software Craftsmanship in the AI Era
lemiorhan
PRO
4
2k
自立を加速させる神器 - EMOasis #11
stanby_inc
0
140
Data Hubグループ 紹介資料
sansan33
PRO
0
2.9k
Practical TypeProf: Lessons from Analyzing Optcarrot
mame
0
340
AWS Agent Registry の基礎・概要を理解する/aws-agent-registry-intro
ren8k
3
380
Microsoft 365 / Microsoft 365 Copilot : 自分の状態を確認する「ラベル」について
taichinakamura
0
230
Pure Intonation on Browser: Building a Sequencer with Ruby
nagachika
0
120
Featured
See All Featured
Building Adaptive Systems
keathley
44
3k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Building the Perfect Custom Keyboard
takai
2
730
Code Review Best Practice
trishagee
74
20k
Designing Powerful Visuals for Engaging Learning
tmiket
1
340
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
190
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
1.1k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.1k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
680
From π to Pie charts
rasagy
0
160
Un-Boring Meetings
codingconduct
0
270
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
110k
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!