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
Architecture en Webservice avec Django
Search
Ordoquy Xavier - Linovia
October 26, 2013
Technology
200
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Architecture en Webservice avec Django
Ordoquy Xavier - Linovia
October 26, 2013
More Decks by Ordoquy Xavier - Linovia
See All by Ordoquy Xavier - Linovia
SQLAlchemy - un ami qui vous veut du bien
xordoquy
0
20
pycon.fr 2018 - Django REST framework workshop
xordoquy
0
350
mauvaises bonnes idées pour REST
xordoquy
1
400
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
150
Other Decks in Technology
See All in Technology
iOS アプリの「これって不具合ですか?」を AI に調べてもらう
miichan
0
130
LayerX コーポレートエンジニアリング室におけるサプライチェーンセキュリティへの取り組み / Supply Chain Security at LayerX Corporate Engineering
yuyatakeyama
3
780
事業会社における 機械学習・推薦システム技術の活用事例と必要な能力 / ml-recsys-in-layerx-wantedly-2026
yuya4
0
120
MUSUBI 田中裕一『AIと共に行う「しごとのリデザイン」- スモールバックオフィス編』AI Ops Lab #4
musubi
0
280
WebGIS AI Agentの紹介
_shimizu
0
310
脱SaaS!FDEを支えるプロビジョニングと分離設計
knih
0
260
PostgreSQL 19 新機能概要 OSC Hokkaido 2026
nori_shinoda
0
210
FPC(フレキシブル)基板にZephyr実装してみた。
iotengineer22
0
150
いまさら聞けない「仕様駆動開発入門」 〜AI活用時代の開発プロセスを考える〜
findy_eventslides
2
180
クレデンシャル流出 ― 攻撃 3 時間 vs 復旧 10 時間。この非対称性にどう備えるか
kazzpapa3
3
470
20260619 私の日常業務での生成 AI 活用
masaruogura
1
240
Flow 不死:AI 時代 DevOps 的不變本質
cheng_wei_chen
2
460
Featured
See All Featured
KATA
mclloyd
PRO
35
15k
Code Reviewing Like a Champion
maltzj
528
40k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
950
Utilizing Notion as your number one productivity tool
mfonobong
4
320
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
320
Testing 201, or: Great Expectations
jmmastey
46
8.2k
A designer walks into a library…
pauljervisheath
211
24k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
Designing for humans not robots
tammielis
254
26k
Accessibility Awareness
sabderemane
1
140
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Transcript
Architecture en Webservices avec Django Xavier Ordoquy Linovia
Freelance! (since 2004) Dev Python Dev Django! (Backend) Mainteneur Raven
(Sentry) Ancien contributeur ! PyGTK Contributions! diverses irc: Linovia @linovia_net
Problèmes d’une architecture classique • Base de code complexe à
maintenir • Evolutions des librairies couteuses en ressources • Isolation • Dimensionnement
Accès à une ressource Web app Indicateurs Export ERP CRM
Sources de données tierces Multi-sites Database
webservice ? • Fournisseur: http://localhost:8000/ • Point d’entrée: /api/v1/users/ •
Contrat d’interface: {‘username’: ‘johndoe’, …}
Architecture Webservice données couche métier présentation AAA
Nouvelle API données couche métier présentation AAA V1 V2
Avantages • Garantie du contrat d’interface • Stabilité dans le
temps • Migration souple • Moins de maintenance • Plus de nouvelles fonctionnalités
OK, et Django ?
Django Rest Framework • Modulaire… • mais pas minimaliste •
Découplé (pas besoin de models) • Idiomes Django (CBV, forms, noms des options…)
Features • Generic views • Serializers • Permissions • Renderers
/ Parsers • Routers • Content negotiation • Filters • Pagination • Throttling • Tests
from rest_framework.decorators import api_view! ! @api_view(['GET'])! def hello_world(request):! return Response({"message":
"Hello, world!"})
class UserSerializer(serializers.ModelSerializer):! class Meta:! model = User! fields = ('email',
'username', ‘last_login')! ! class UserViewSet(viewsets.ModelViewSet):! queryset = User.objects.all()! serializer_class = UserSerializer! permission_classes = (permissions.IsAuthenticatedOrReadOnly)! ! router = DefaultRouter()! router.register(r'user', UserViewSet)
Et les performances avec Django ?
Qui pense que Django EST rapide ?
Qui pense que Django EST rapide lent ?
None
None
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
Django-roa • Resource Oriented Architecture • Coté client • Simplifie
la séparation • Integration avec rest framework (bientôt avec les serializers)
Exemple class Tweet(roa.Model):! text = models.TextField()! source = models.CharField(max_length=50)! user
= models.ForeignKey(User)! ! @staticmethod! def get_resource_url_list():! return u'http://twitter.com/statuses/public_timeline.json'
None
Merci • http://django-rest-framework.org • http://code.larlet.fr/django-roa/wiki/Home • http://bit.ly/1d8hOyV • http://bit.ly/1adlAs9