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.5k
London Django Sprint Intro
bmispelon
0
940
Budapest.py January 2015 Intro
bmispelon
0
78
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
Babylon.js を使って試した色々な内容 / Various things I tried using Babylon.js / Babylon.js 勉強会 vol.5
you
PRO
0
200
Babylon.js Japan Activities (2026/4)
limes2018
0
150
不確実性と戦いながら見積もりを作成するプロセス/mitsumori-process
hirodragon112
1
180
AI時代のシステム開発者の仕事_20260328
sengtor
0
320
Data Enabling Team立ち上げました
sansantech
PRO
0
210
Move Fast and Break Things: 10 in 20
ramimac
0
120
I ran an automated simulation of fake news spread using OpenClaw.
zzzzico
1
520
JSTQB Expert Levelシラバス「テストマネジメント」日本語版のご紹介
ymty
0
110
Oracle Cloud Infrastructure:2026年3月度サービス・アップデート
oracle4engineer
PRO
0
320
会社紹介資料 / Sansan Company Profile
sansan33
PRO
16
410k
Databricks Lakehouse Federationで 運用負荷ゼロのデータ連携
nek0128
0
110
The essence of decision-making lies in primary data
kaminashi
0
230
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Mind Mapping
helmedeiros
PRO
1
140
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
120
Test your architecture with Archunit
thirion
1
2.2k
Crafting Experiences
bethany
1
100
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
660
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.6k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
So, you think you're a good person
axbom
PRO
2
2k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.4k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
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!