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
170
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
80
Baptiste's adventures in Djangoland
bmispelon
0
1.4k
London Django Sprint Intro
bmispelon
0
920
Budapest.py January 2015 Intro
bmispelon
0
64
Announcing: Django Under the Hood
bmispelon
1
120
Stdlib Safari - Exotic Animal Edition
bmispelon
2
190
Tales From the Django Circus
bmispelon
0
200
Other Decks in Technology
See All in Technology
RubyでKubernetesプログラミング
sat
PRO
4
150
機械学習を「社会実装」するということ 2025年版 / Social Implementation of Machine Learning 2025 Version
moepy_stats
4
790
三菱電機で社内コミュニティを立ち上げた話
kurebayashi
1
350
「隙間家具OSS」に至る道/Fujiwara Tech Conference 2025
fujiwara3
6
6.3k
Building Scalable Backend Services with Firebase
wisdommatt
0
110
あなたの知らないクラフトビールの世界
miura55
0
110
あなたの人生も変わるかも?AWS認定2つで始まったウソみたいな話
iwamot
3
820
東京Ruby会議12 Ruby と Rust と私 / Tokyo RubyKaigi 12 Ruby, Rust and me
eagletmt
3
840
Goで実践するBFP
hiroyaterui
1
120
30分でわかるデータ分析者のためのディメンショナルモデリング #datatechjp / 20250120
kazaneya
PRO
22
4.7k
🌏丸い地球を効率的に平たくする 〜🗺️地図の幾何学とWeb地図技術〜
syotasasaki593876
0
140
駆け出しリーダーとしての第一歩〜開発チームとの新しい関わり方〜 / Beginning Journey as Team Leader
kaonavi
0
120
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
328
38k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.1k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Practical Orchestrator
shlominoach
186
10k
A better future with KSS
kneath
238
17k
Automating Front-end Workflow
addyosmani
1366
200k
How to train your dragon (web standard)
notwaldorf
89
5.8k
Thoughts on Productivity
jonyablonski
68
4.4k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.2k
Learning to Love Humans: Emotional Interface Design
aarron
274
40k
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!