Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Django APIs + React (Django Boston - May 2018)
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
William S. Vincent
May 01, 2018
Technology
85
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Django APIs + React (Django Boston - May 2018)
Learn about modern web development with Django REST Framework and ReactJS.
William S. Vincent
May 01, 2018
More Decks by William S. Vincent
See All by William S. Vincent
Django for AI: Deploying Machine Learning Models with Django
wsvincent
0
30
DjangoCon Europe 2025 Keynote - Django for Data Science
wsvincent
0
1.6k
Django for Data Science (Boston Python Meetup, March 2025)
wsvincent
0
960
DjangoConUS 2024 - Django User Model: Past, Present, and Future
wsvincent
0
120
DjangoCon US 2022 - Solving the Django Jigsaw Puzzle
wsvincent
0
130
DjangoCon US 2019 - Search from the Ground Up
wsvincent
0
490
8 Reasons Why Learning Django is Hard (Django Boston - January 2019)
wsvincent
0
120
DjangoCon US 2018 - Finally Understand User Authentication in Django REST Framework
wsvincent
0
71
Other Decks in Technology
See All in Technology
新機種発売前に見直そう!端末移行で再ログインが要るアプリ・要らないアプリは何が違うのか 〜シームレスに再開できる設計と実装〜
zozotech
PRO
0
200
ソフトウェアDNAとクラウドエージェントのススメ
cloudace
0
110
【技術的負債conf】事業成長に伴う技術的負債の説明責任とAIによるモニタリング、認知的負債について
i35_267
3
1.7k
Deployment の 先にある AI Agent 基盤 - kagent vNext、Agent Substrate、Hermes から読み解く Agent Runtime の現在地 / k8s-matsuri-2-ai-agent-platform-amsy810
masayaaoyama
4
640
Claude Codeを「使うほど育つ」AI秘書にするノウハウ
minorun365
PRO
31
26k
synctest時代のhttptest Go 1.27で変わるHTTPサーバテストの裏側 / go conference2026 synctest and httptest
budougumi0617
1
3k
30座EKS, 180次升級淬煉的EKS Upgrade Skill 的歷程
eric8230
0
170
AIによるクリエイティブ生成を行う上での試行錯誤
plaidtech
PRO
0
160
EventBridge に「合流」はない ― サーバーレスのワークフローを育てるということ / No Join in EventBridge
yusukeshimizu
2
110
AI 時代のスタートアップエコシステ厶から考究する技術的負債との向き合い方
m3m0r7
PRO
3
2.2k
AIを活用するために決めた "やらないこと" - 価値に注目する / Not betting on AI
soudai
PRO
2
550
なぜ「決定性」が 決定的に重要なのか? Durable Execution 基盤の数理的理解 #serverlessjp / ServerlessDays Tokyo 2026
ytaka23
1
390
Featured
See All Featured
Marketing to machines
jonoalderson
1
5.8k
A better future with KSS
kneath
240
18k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Designing Powerful Visuals for Engaging Learning
tmiket
1
550
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
520
Technical Leadership for Architectural Decision Making
baasie
3
570
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.3k
New Earth Scene 8
popppiees
4
2.6k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Transcript
William S. Vincent Django APIs + React Django Boston (May
2018) Modern web development with Django Rest Framework & ReactJS
William S. Vincent Who Am I? • Freelance software developer
• Early employee at Quizlet, other startups • Books
William S. Vincent API • Application Programming Interface (API) •
Way for 2 computers to communicate • Need agreed-upon rules (a protocol)
William S. Vincent Why APIs? Pros • Future proof •
Multiple frontends (iOS, Android, web) • Internal or external access Cons • More set up required • User auth is tricky (sessions, tokens, JWT) • JS frameworks change
William S. Vincent What is a web API?
William S. Vincent HTTP • HTTP: Communications protocol for the
web • Web APIs sit “on top” of HTTP • API endpoints: url + available HTTP verbs
William S. Vincent HTTP Verbs Functionality Create Read Update Delete
HTTP Method/Verb POST GET PUT DELETE Rough equivalence between CRUD & HTTP verbs
William S. Vincent HTTP Status Codes Code 2xx 3xx 4xx
5xx Meaning Success (200, 201) Redirection (301) Client error (404) Server error (500)
William S. Vincent API Endpoints • https://mysite.com/api/users # GET returns
collection of all users • https://mysite.com/api/users/<id> # GET returns a single user
William S. Vincent Django APIs
William S. Vincent Building APIs with Django • Multiple packages
available • Django Rest Framework the clear favorite ◦ Easily add to existing Django sites ◦ Complete feature set ◦ Very mature
William S. Vincent Django vs Django API Structure Django template.html
urls.py views.py models.py Django API serializers.py
William S. Vincent Django Rest Framework
William S. Vincent Django + DRF • Add DRF to
existing(!) Django sites • Only need models.py file from regular Django • Write DRF-specific urls.py, views.py, and serializers.py files
William S. Vincent Django Blog 1. Create a new Django
project/app 2. Update models.py and admin.py 3. Add blog posts via Django admin https://github.com/wsvincent/djangoboston-drf-react-blog
William S. Vincent Adding DRF • Install, update settings.py •
Update urls.py (project/app level) • Update views.py
William S. Vincent Serializers • The real “magic” of Django
Rest Framework • Transform models/querysets into JSON • Deserializers transform data from client back into complex data types too
William S. Vincent Serializers # posts/serializers.py from rest_framework import serializers
from . import models class PostSerializer(serializers.ModelSerializer): class Meta: fields = ('id', 'title', 'body',) model = models.Post
William S. Vincent Browsable API
William S. Vincent CORS (Cross-Origin Resource Sharing) • Fundamental security
feature of the web • Allows for cross-domain requests • HTTP Headers added
William S. Vincent What We Didnʼt Cover • Viewsets/Routers •
Authentication/Permissions • Documentation • Tests, Throttling, Pagination, etc.
William S. Vincent Adding React Or Vue, Angular, etc...
William S. Vincent React setup
William S. Vincent Project structure frontend ├── public ├── src
├── App.js backend ├── backend_project ├── settings.py ├── urls.py ├── posts ├── models.py ├── serializers.py ├── views.py ├── urls.py
William S. Vincent App.js • Only need to update one
file! • Endpoint: http://127.0.0.1:8000/api/v1/ • Use map() to display all blog posts
William S. Vincent Conclusion • Add DRF to an existing
Django project • Add CORS headers! • Use create-react-app • Run frontend/backend in two consoles
William S. Vincent Resources Django Rest Framework Docs http://www.django-rest-framework.org/ Demo
Project https://github.com/wsvincent/djangoboston-drf-react-blog Slides https://tinyurl.com/drf-react My Site https://wsvincent.com/