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
The year ahead (DjangoCon 2012)
Search
adrianholovaty
September 05, 2012
Programming
1
620
The year ahead (DjangoCon 2012)
BDFL keynote from DjangoCon US (Washington, DC), Sept. 5, 2012.
adrianholovaty
September 05, 2012
Tweet
Share
More Decks by adrianholovaty
See All by adrianholovaty
Some random Django tips
adrianholovaty
1
480
Other Decks in Programming
See All in Programming
PicoRubyと暮らす、シェアハウスハック
ryosk7
0
200
chibiccをCILに移植した結果 (NGK2025S版)
kekyo
PRO
0
110
カンファレンス動画鑑賞会のススメ / Osaka.swift #1
hironytic
0
160
AWSのLambdaで PHPを動かす選択肢
rinchoku
2
390
良いユニットテストを書こう
mototakatsu
11
3.6k
Androidアプリのモジュール分割における:x:commonを考える
okuzawats
1
270
テストコードのガイドライン 〜作成から運用まで〜
riku929hr
7
1.4k
AHC041解説
terryu16
0
330
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
390
いりゃあせ、PHPカンファレンス名古屋2025 / Welcome to PHP Conference Nagoya 2025
ttskch
1
150
Flatt Security XSS Challenge 解答・解説
flatt_security
0
710
Запуск 1С:УХ в крупном энтерпрайзе: мечта и реальность ПМа
lamodatech
0
940
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
570
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
Building Flexible Design Systems
yeseniaperezcruz
328
38k
Agile that works and the tools we love
rasmusluckow
328
21k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.5k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
Done Done
chrislema
182
16k
How to train your dragon (web standard)
notwaldorf
89
5.8k
A Tale of Four Properties
chriscoyier
157
23k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Transcript
None
None
None
None
None
None
None
None
None
The year ahead Adrian Holovaty DjangoCon 2012
• Alpha: Oct. 1 (feature freeze, branch created) • Beta:
Nov. 1-ish • Release candidate 1: end of November • Release candidate 2: early December • Final: Christmas! Django 1.5 timeline
None
None
Separate localflavor packages django-localflavor-ar django-localflavor-at django-localflavor-au django-localflavor-be django-localflavor-br django-localflavor-ca django-localflavor-ch
django-localflavor-cl django-localflavor-cn ...
• Django 1.5: Deprecation warning • Django 1.6: Separate (bundled)
packages, shim in repo • Django 1.7: HTTP 410 (GONE) Deprecation policy
>>> from django.contrib import comments Traceback (most recent call last):
File "<stdin>", line 1, in <module> ImportError: What, you actually USE this monstrosity?!
>>> from django.contrib import databrowse Traceback (most recent call last):
File "<stdin>", line 1, in <module> ImportError: Sorry, it was a cool concept, but we never got around to finishing it.
>>> from django.conf import settings >>> settings.PROFANITIES_LIST Traceback (most recent
call last): File "<stdin>", line 1, in <module> FrameworkPlea: Oh, God, please just let this setting die already.
>>> from django.conf import settings >>> settings.SEND_BROKEN_LINK_EMAILS = True Traceback
(most recent call last): File "<stdin>", line 1, in <module> StupidSettingsError: C’mon.
>>> from django.conf import settings >>> settings.SEND_BROKEN_LINK_EMAILS = True Traceback
(most recent call last): File "<stdin>", line 1, in <module> StupidSettingsError:
>>> from django.conf import settings >>> settings.AUTH_PROFILE_MODULE Traceback (most recent
call last): File "<stdin>", line 1, in <module> ThatStinks: Code smell detected
class User(models.Model): username = models.CharField(max_length=30, unique=True) first_name = models.CharField(max_length=30, blank=True)
last_name = models.CharField(max_length=30, blank=True) email = models.EmailField(blank=True) password = models.CharField(max_length=128) is_staff = models.BooleanField(default=False) is_active = models.BooleanField(default=True) is_superuser = models.BooleanField(default=False) last_login = models.DateTimeField(default=timezone.now) date_joined = models.DateTimeField(default=timezone.now) groups = models.ManyToManyField(Group) user_permissions = models.ManyToManyField(Permission)
In myapp/models.py from django.contrib.auth.models import User class UserProfile(models.Model): user =
models.OneToOneField(User) # required # Other fields here favorite_animal = models.CharField(max_length=20) favorite_beatle = models.CharField(max_length=20)
In myapp/models.py from django.contrib.auth.models import User class UserProfile(models.Model): user =
models.OneToOneField(User) # required # Other fields here favorite_animal = models.CharField(max_length=20) favorite_beatle = models.CharField(max_length=20) In settings.py AUTH_PROFILE_MODULE = 'myapp.UserProfile'
In myapp/models.py from django.contrib.auth.models import User class UserProfile(models.Model): user =
models.OneToOneField(User) # required # Other fields here favorite_animal = models.CharField(max_length=20) favorite_beatle = models.CharField(max_length=20) In settings.py AUTH_PROFILE_MODULE = 'myapp.UserProfile' In views.py request.user.get_profile()
In myapp/models.py class User(models.Model): username = models.CharField(max_length=100) password = models.CharField(max_length=128)
favorite_animal = models.CharField(max_length=20) favorite_beatle = models.CharField(max_length=20)
In myapp/models.py class User(models.Model): username = models.CharField(max_length=100) password = models.CharField(max_length=128)
favorite_animal = models.CharField(max_length=20) favorite_beatle = models.CharField(max_length=20) In settings.py USER_MODEL = 'myapp.User'
In myapp/models.py class User(models.Model): username = models.CharField(max_length=100) password = models.CharField(max_length=128)
favorite_animal = models.CharField(max_length=20) favorite_beatle = models.CharField(max_length=20) In settings.py USER_MODEL = 'myapp.User' In views.py request.user
• Backwards compatible: fall back to old auth.User model •
Any User model can work with the admin, using a clearly defined interface Design goals
ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is
undefined.
def mypage(request, slug): obj = MyModel.objects.get(slug=slug) return render(request, 'mypage.html', {'obj':
obj})
def mypage(request, slug): obj = MyModel.objects.get(slug=slug) return render(request, 'mypage.html', {'obj':
obj}) Connection info?
def mypage(request, slug): obj = MyModel.objects.get(slug=slug) return render(request, 'mypage.html', {'obj':
obj}) Connection info? Template location?
def mypage(request, slug): obj = request.app.query(MyModel).get(slug=slug) return request.app.render('mypage.html', {'obj': obj})
def mypage(request, slug): obj = request.app.query(MyModel).get(slug=slug) return request.app.render('mypage.html', {'obj': obj})
app.query()
def mypage(request, slug): obj = request.app.query(MyModel).get(slug=slug) return request.app.render('mypage.html', {'obj': obj})
app.query() app.render()
def mypage(request, slug): obj = request.app.query(MyModel).get(slug=slug) return request.app.render('mypage.html', {'obj': obj})
from django import YetAnotherAppClass app = YetAnotherAppClass(settings={ 'DATABASES': '...', 'TEMPLATE_DIRS': ['/path/to/templates'], }, rootview=my_urls) app.runserver()
>>> from django import javascript_stuff Traceback (most recent call last):
File "<stdin>", line 1, in <module> NotImplementedYet: But it’s about time.
PJAX (P = pushstate)
Web framework
Web framework returns full page Web framework returns full page
None
Web framework returns full page Web framework returns *diff* and
changes URL
Overview
Overview Click link Trigger Ajax request
Overview Click link Trigger Ajax request Server says: “These bits
changed”
Overview Click link Trigger Ajax request Server says: “These bits
changed” JavaScript changes the page in place
Overview Click link Trigger Ajax request Server says: “These bits
changed” JavaScript changes the page in place URL gets updated with pushstate
MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.pjax.middleware.PjaxMiddleware', )
http://tinyurl.com/pjaxvideo
Real-time
Content sites Applications # of sites
Content sites Applications # of sites
Content sites Applications # of sites Move this to the
right
Thanks for using Django Love, Adrian