Django for Beginners (Book)
$39.00
Minimum price
$39.00
Suggested price

Django for Beginners

Build websites with Python and 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
  • Implement signup, login, logout, password change, and password reset
  • Customize the look and feel of your sites
  • Write tests and run them for all your code
  • 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.

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

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. A Board Member of the Django Software Foundation, he was previously an early employee at Quizlet and taught computer science at Williams College. He writes regularly about Python and Django at LearnDjango.com.

Bundles that include this book

$117.00
Bought separately
$97.00
Bundle Price

Table of Contents

  • Chapter 0: Introduction
    • Prerequisites
    • Why Django
    • Why This Book
    • What’s New in Django 4.2
    • Book Structure
    • Book Layout
    • Advice on Getting Stuck
    • Community
    • 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
    • PyPI (Python Package Index)
    • Install Django
    • First Django Project
    • The Development Server
    • Text Editors
    • VSCode Configurations
    • Install Git
    • Conclusion
  • Chapter 2: Hello World App
    • How Websites Work
    • How Web Frameworks Work
    • Model-View-Controller vs Model-View-Template
    • Initial Set Up
    • Create An App
    • Your First View
    • URLconfs
    • 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
    • Hosting Options
    • Deployment Checklist
    • Fly.io
    • Deploy to Fly.io
    • Conclusion
  • Chapter 4: Message Board App
    • Initial Set Up
    • Create a Database Model
    • Activating models
    • Django Admin
    • Views/Templates/URLs
    • Adding New Posts
    • Static Files
    • Tests
    • GitHub
    • Conclusion
  • Chapter 5: Message Board Deployment
    • Previous Deployment Checklist
    • Environment Variables
    • DATABASES
    • Pyscopg
    • CSRF_TRUSTED_ORIGINS
    • Updated Deployment Checklist
    • Web Servers
    • WSGI
    • ASGI
    • WhiteNoise
    • Middleware
    • requirements.txt
    • Final Deployment Checklist
    • Fly Deployment
    • Production Database
    • Conclusion
  • Chapter 6: Blog App
    • Initial Set Up
    • Databases
    • Django’s ORM
    • Blog Post Models
    • Primary Keys and Foreign Keys
    • Admin
    • URLs
    • Views
    • Templates
    • Static Files
    • Individual Blog Pages
    • get_absolute_url()
    • Tests
    • Git
    • Conclusion
  • Chapter 7: Forms
    • CreateView
    • UpdateView
    • DeleteView
    • Tests
    • Conclusion
  • Chapter 8: User Accounts
    • Log In
    • Updated Homepage
    • Log Out Link
    • Sign Up
    • Sign Up Link
    • Static Files
    • GitHub
    • Conclusion
  • Chapter 9: Blog Deployment
    • Gunicorn, Psycopg, and environs
    • DATABASES
    • WhiteNoise
    • requirements.txt
    • .dockerignore and .env
    • DEBUG
    • SECRET_KEY
    • ALLOWED_HOSTS and CSRF_TRUSTED_ORIGINS
    • Fly Launch
    • Updated ALLOWED_HOSTS and CSRF_TRUSTED_ORIGINS
    • Fly Deployment
    • Conclusion
  • Chapter 10: Custom User Model
    • Initial Set Up
    • Git
    • Custom User Model
    • Forms
    • Superuser
    • Tests
    • Git
    • Conclusion
  • Chapter 11: User Authentication
    • Templates
    • URLs
    • Admin
    • Tests
    • Git
    • Conclusion
  • Chapter 12: Bootstrap
    • Pages App
    • Tests
    • Testing Philosophy
    • Bootstrap
    • Signup Form
    • Git
    • Conclusion
  • Chapter 13: Password Change and Reset
    • Password Change
    • Customizing Password Change
    • Password Reset
    • Custom Templates
    • Try It Out
    • Git
    • Conclusion
  • Chapter 14: Newspaper App
    • Articles App
    • URLs and Views
    • Detail/Edit/Delete
    • Create Page
    • Additional Links
    • Git
    • Conclusion
  • Chapter 15: Permissions and Authorization
    • Improved CreateView
    • Authorizations
    • Mixins
    • LoginRequiredMixin
    • UpdateView and DeleteView
    • Template Logic
    • Git
    • Conclusion
  • Chapter 16: Comments
    • Model
    • Admin
    • Template
    • Comment Form
    • Comment View
    • Comment Template
    • Comment Post View
    • New Comment Link
    • Git
    • Conclusion
  • Chapter 17: Deployment
    • Static Files
    • Deployment Checklist
    • Gunicorn, Psycopg, and environs
    • DATABASES
    • WhiteNoise
    • requirements.txt
    • .dockerignore and .env
    • DEBUG and SECRET_KEY
    • ALLOWED_HOSTS and CSRF_TRUSTED_ORIGINS
    • Fly Deployment
    • Production Database
    • Deployment Conclusion
  • Chapter 18: Conclusion
    • Next Steps
    • 3rd Party Packages
    • Learning Resources
    • Python Books
    • Feedback

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...

80% Royalties. Earn $16 on a $20 book.

We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course 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

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 and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub