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
Some things to know about Django Rest Framework
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Ordoquy Xavier - Linovia
December 12, 2013
Programming
250
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Some things to know about Django Rest Framework
Ordoquy Xavier - Linovia
December 12, 2013
More Decks by Ordoquy Xavier - Linovia
See All by Ordoquy Xavier - Linovia
SQLAlchemy - un ami qui vous veut du bien
xordoquy
0
29
pycon.fr 2018 - Django REST framework workshop
xordoquy
0
360
mauvaises bonnes idées pour REST
xordoquy
1
410
Authentication and Permissions with Django REST framework
xordoquy
0
200
Buildbot 0.9
xordoquy
0
110
Performances Django REST framework - DjangoCong 2016
xordoquy
0
130
Présentation de l'architecture REST - meetup Django Paris
xordoquy
0
110
Django REST framework workshop @Djangocon Europe 2015
xordoquy
0
130
Django REST framework - DjangoConG 2015
xordoquy
3
160
Other Decks in Programming
See All in Programming
{ Android | Kotlin } Gradle Plugin in 2026
ryunen344
1
290
AIエージェント時代のコードレビューを設計する
nogu66
6
2.6k
Press start. Python's next generation.
willingc
PRO
3
320
【デモ】Kiroで体験する仕様駆動開発|設計からコーディングまでAIと進める開発フロー
cmkudo
0
600
異なる設計思想のフレームワークを経験して得た学び
amekuhideki
2
1.5k
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
1
680
20260828_品質と開発生産性を両立させる、AI時代のE2Eテストの考え方
magicpod
0
170
FastAPI の並行処理モデルを完全に理解する
hoto17296
9
3.8k
LL言語やWebフレームワークのPostgreSQL対応 〜DBの機能がユーザーに届くまで〜
kentaroutakeda
0
140
ソフトウェアラスタライザ
fadis
1
790
変化を抱擁するドキュメントの作り方 - ビジネスルール駆動開発がもたらす、コードとの新しい関係
ioki
2
120
[DroidKaigi 2026] Bring your own phones to Gradle Managed Devices
f2lk
0
110
Featured
See All Featured
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
370
エンジニアに許された特別な時間の終わり
watany
108
250k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.9k
Utilizing Notion as your number one productivity tool
mfonobong
4
570
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Fireside Chat
paigeccino
42
4k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
540
What does AI have to do with Human Rights?
axbom
PRO
1
2.4k
Visualization
eitanlees
152
17k
Git: the NoSQL Database
bkeepers
PRO
432
67k
Embracing the Ebb and Flow
colly
88
5.2k
Abbi's Birthday
coloredviolet
3
9.8k
Transcript
Django Rest Framework Tips and Tricks Xavier ORDOQUY @linovia_net
Freelance! (since 2004) Python Django! (Backend) Raven maintainer! (Sentry client)
Former! PyGTK! contributor Various! pull requests irc: Linovia @linovia_net Expertise Dev
Reminder • It is Django ! ! • It is
Python !
Fully featured • Serializers • ModelSerializers • Parsers • Renderers
• Authentication • Permission • Throttling • Routers • Views • ViewSets • Filtering • Testing • Pagination
from rest_framework.decorators import api_view! ! @api_view(['GET'])! def hello_world(request):! return Response({"message":
"Hello, world!"}) but loosely coupled Authentication Content negotiation Serializers Generic views
Customizable web interface
Debug toolbar
pre/post save class MyCreateView(CreateAPIView):! model = models.MyModel! serializer_class = serializers.MySerializer!
! def post_save(self, obj, created):! if created:! obj.reviewers = [user1, user2]!
Class based views class MyMixin(object):! model = models.MyModel! serializer_class =
serializers.MySerializer! ! ! class MyCreateView(MyMixin, CreateAPIView):! pass! • MRO: mixins are on the left side
# views.py! class UserViewSet(viewsets.ModelViewSet):! queryset = User.objects.all()! serializer_class = UserSerializer!
! # urls.py! router = DefaultRouter()! router.register(r'users', views.UserViewSet)! ! urlpatterns = patterns('',! url(r'^', include(router.urls)),! )! Viewsets & routers Nice to get started but optional
Auth / Permissions • Auth are for knowing who you
are ! • Permissions are to grant you access
Testing Utilities • APIRequestFactory + format ! • force_authenticate •
APIClient response = self.client.get('/users/4/')! self.assertEqual(response.data,! {'id': 4, 'username': 'lauren'})!
Performances • Fast to prototype • Easy to tune •
Django performance tips also applies !
Temps em ms 0 10 20 30 40 50 60
70 80 90 100 110 120 130 140 Full stack Serialisation Redis Content nego Middleware HttpResponse Database lookup Redis lookup Serialization Django request/response API view Response rendering
None
• Django Rest Framwork Optimization: http://dabapps.com/blog/api-performance-profiling-django-rest-framework/