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
180
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
87
Baptiste's adventures in Djangoland
bmispelon
0
1.4k
London Django Sprint Intro
bmispelon
0
930
Budapest.py January 2015 Intro
bmispelon
0
71
Announcing: Django Under the Hood
bmispelon
1
140
Stdlib Safari - Exotic Animal Edition
bmispelon
2
190
Tales From the Django Circus
bmispelon
0
210
Other Decks in Technology
See All in Technology
Observability infrastructure behind the trillion-messages scale Kafka platform
lycorptech_jp
PRO
0
130
実践! AIエージェント導入記
1mono2prod
0
150
強化されたAmazon Location Serviceによる新機能と開発者体験
dayjournal
2
170
Prox Industries株式会社 会社紹介資料
proxindustries
0
210
Абьюзим random_bytes(). Фёдор Кулаков, разработчик Lamoda Tech
lamodatech
0
300
Navigation3でViewModelにデータを渡す方法
mikanichinose
0
220
CI/CDとタスク共有で加速するVibe Coding
tnbe21
0
230
UIテスト自動化サポート- Testbed for XCUIAutomation practice
notoroid
0
120
CSS、JSをHTMLテンプレートにまとめるフロントエンド戦略
d120145
0
250
Agentic DevOps時代の生存戦略
kkamegawa
1
1.1k
成立するElixirの再束縛(再代入)可という選択
kubell_hr
0
960
Node-RED × MCP 勉強会 vol.1
1ftseabass
PRO
0
110
Featured
See All Featured
Adopting Sorbet at Scale
ufuk
77
9.4k
Docker and Python
trallard
44
3.4k
Reflections from 52 weeks, 52 projects
jeffersonlam
351
20k
Optimizing for Happiness
mojombo
379
70k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
48
5.4k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
For a Future-Friendly Web
brad_frost
179
9.8k
Practical Orchestrator
shlominoach
188
11k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
KATA
mclloyd
29
14k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
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!