Django for APIs
Django for APIs
Build web APIs with Python and Django
About the Book
Django for APIs is a project-based guide to building modern web APIs with Django & Django REST Framework. It is suitable for beginners who have never built an API before as well as professional programmers looking for a fast-paced introduction to Django fundamentals and best practices.
Over the course of 200+ pages you'll learn how to set up a new project properly, how web APIs work under the hood, and advanced testing and deployment techniques. Three separate projects are built from scratch with progressively more advanced features including a Library API, Todo API, and Blog API. User authentication, permissions, documentation, viewsets, and routers are all covered thoroughly.
Django for APIs is a best-practices guide to building powerful Python-based web APIs with a minimal amount of code.
Reviews
"If you’re looking for a guide into the world of Django, then the three-step of Django for Beginners, Django for APIs, and Django for Professionals is ideal: get up and running, get into APIs, which are a cornerstone of modern app development, and then add the bits you need to your fledging app into production, from databases and static files, to user accounts and security. It’s a long road. Will’s books are an awesome companion."—CARLTON GIBSON, Django Fellow and Django REST Framework core contributor
"When readers interested in web development ask me what to read next after Python Crash Course, I refer them to Will's books: Django for Beginners, Django for APIs, and Django for Professionals. I highly recommend you check out his work."—ERIC MATTHES, author of Python Crash Course
"Will's books are a fantastic resource for web development with Django and Python. I highly recommended them.”—JEFF TRIPLETT, Python Software Foundation Director, DEFNA President, and REVSYS Partner
Bundles that include this book
Table of Contents
-
Introduction
- Why APIs
- Django REST Framework
- Prerequisites
- Why this book
- Conclusion
-
Chapter 1: Initial Set Up
- The Command Line
- Shell Commands
- Install Python 3 on Windows
- Install Python 3 on Mac
- Python Interactive Mode
- Virtual Environments
- Install Django and Django REST Framework
- Text Editors
- Install Git
- Conclusion
-
Chapter 2: Web APIs
- World Wide Web
- URLs
- Internet Protocol Suite
- HTTP Verbs
- Endpoints
- HTTP
- Status Codes
- Statelessness
- REST
- Conclusion
-
Chapter 3: Library Website
- Traditional Django
- First app
- Models
- Admin
- Views
- URLs
- Templates
- Tests
- Git
- Conclusion
-
Chapter 4: Library API
- Django REST Framework
- URLs
- Views
- Serializers
- Browsable API
- Tests
- Deployment
- Static Files
- Deployment Checklist
- GitHub
- Heroku
- Conclusion
-
Chapter 5: Todo API
- Single Page Apps (SPAs)
- Initial Set Up
- .gitignore
- Models
- Tests
- Django REST Framework
- URLs
- Serializers
- Views
- Browsable API
- API Tests
- CORS
- CSRF
- Back-End API Deployment
- Conclusion
-
Chapter 6: Blog API
- Initial Set Up
- .gitignore
- Custom User Model
- Posts App
- Post Model
- Tests
- Django REST Framework
- URLs
- Serializers
- Views
- Browsable API
- CORS
- Conclusion
-
Chapter 7: Permissions
- Project-Level Permissions
- Create New Users
- Add Log In and Log Out
- View-Level Permissions
- Custom Permissions
- Conclusion
-
Chapter 8: User Authentication
- Basic Authentication
- Session Authentication
- Token Authentication
- Default Authentication
- Implementing token authentication
- Endpoints
- dj-rest-auth
- User Registration
- Tokens
- Conclusion
-
Chapter 9: Viewsets and Routers
- User endpoints
- Viewsets
- Routers
- Permissions
- Conclusion
-
Chapter 10: Schemas and Documentation
- Schema
- Dynamic Schema
- Documentation
- Conclusion
-
Chapter 11: Production Deployment
- Environment Variables
- DEBUG & SECRET_KEY
- ALLOWED HOSTS
- DATABASES
- Static Files
- Pyscopg and Gunicorn
- requirements.txt
- Procfile and runtime.txt
- Deployment Checklist
- Heroku Deployment
-
Conclusion
- Advanced Topics
- Next Steps
- Giving Thanks
Other books by this author
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $13 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them