Django for Beginners (Book)
Minimum price
Suggested price

Django for Beginners

Build websites with Python & Django

About the Book

Django for Beginners is a project-based introduction to Django, the popular Python-based web framework. Suitable for total beginners who have never built a website before as well as professional programmers looking for a fast-paced guide to modern web development and Django fundamentals.

In the book you’ll learn how to:

  • Build 5 websites from scratch, including a Blog and Newspaper
  • Deploy online using security best practices
  • Customize the look and feel of your sites
  • Write tests and run them for all your code
  • Integrate user authentication, email, and custom user models
  • Add permissions and authorizations to make your app more secure

If you’re curious about Python-based web development, Django for Beginners is a best-practices guide to writing and deploying your own websites quickly.



"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

About the Author

William S. Vincent
William S. Vincent

William S. Vincent is the author of Django for Beginners, Django for APIs, and Django for Professionals. Previously an early employee at Quizlet, he has used Django at multiple early-stage startups in the Boston area and taught computer science at Williams College. He writes regularly about Python and Django at

Bundles that include this book

Suggested Price
Bundle Price

Table of Contents

  • Introduction
    • Why Django
    • Why This Book
    • Book Structure
    • Book Layout
    • Official Source Code
    • Conclusion
  • Chapter 1: Initial Set Up
    • The Command Line
    • Install Python 3
    • Virtual Environments
    • Install Django
    • Install Git
    • Text Editors
    • Conclusion
  • Chapter 2: Hello World App
    • Initial Set Up
    • Create An App
    • URLs, Views, Models, Templates
    • Hello, World!
    • Git
    • GitHub
    • SSH Keys
    • Conclusion
  • Chapter 3: Pages App
    • Initial Set Up
    • Templates
    • Class-Based Views
    • URLs
    • About Page
    • Extending Templates
    • Tests
    • Git and GitHub
    • Local vs Production
    • Heroku
    • Deployment
    • Conclusion
  • Chapter 4: Message Board App
    • Initial Set Up
    • Create a database model
    • Activating models
    • Django Admin
    • Views/Templates/URLs
    • Adding New Posts
    • Tests
    • GitHub
    • Heroku Configuration
    • Heroku Deployment
    • Conclusion
  • Chapter 5: Blog App
    • Initial Set Up
    • Database Models
    • Admin
    • URLs
    • Views
    • Templates
    • Static Files
    • Individual Blog Pages
    • Tests
    • Git
    • Conclusion
  • Chapter 6: Forms
    • Forms
    • Update Form
    • Delete View
    • Tests
    • Conclusion
  • Chapter 7: User Accounts
    • Log In
    • Updated Homepage
    • Log Out Link
    • Sign Up
    • GitHub
    • Static Files
    • Heroku Config
    • Heroku Deployment
    • Conclusion
  • Chapter 8: Custom User Model
    • Initial Set Up
    • Custom User Model
    • Forms
    • Superuser
    • Conclusion
  • Chapter 9: User Authentication
    • Templates
    • URLs
    • Admin
    • Conclusion
  • Chapter 10: Bootstrap
    • Pages App
    • Tests
    • Bootstrap
    • Sign Up Form
    • Conclusion
  • Chapter 11: Password Change and Reset
    • Password Change
    • Customizing Password Change
    • Password Reset
    • Custom Templates
    • Conclusion
  • Chapter 12: Email
    • SendGrid
    • Custom Emails
    • Conclusion
  • Chapter 13: Newspaper App
    • Articles App
    • URLs and Views
    • Edit/Delete
    • Create Page
    • Conclusion
  • Chapter 14: Permissions and Authorization
    • Improved CreateView
    • Authorizations
    • Mixins
    • LoginRequiredMixin
    • UpdateView and DeleteView
    • Conclusion
  • Chapter 15: Comments
    • Model
    • Admin
    • Template
    • Conclusion
  • Chapter 16: Deployment
    • Environment Variables
    • .gitignore
    • Static Files
    • Deployment Checklist
    • Git & GitHub
    • Heroku Deployment
    • Conclusion
  • Conclusion
    • Django For Professionals
    • Django for APIs
    • 3rd Party Packages
    • Learning Resources
    • Python Books
    • Feedback

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

Do Well. Do Good.

Authors have earned$10,891,199writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.

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), EPUB (for phones and tablets) and MOBI (for 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

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF, EPUB and/or MOBI files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub