โหมดทดลอง — การชำระเงินเป็นการจำลอง และอีเมลทั้งหมดจะไปที่ กล่องอีเมลทดลอง · ระบบจำลองการชำระเงิน
DDSP
ภาพปก Django and Python Web Development — page spread 1 Django and Python Web Development — page spread 2 Django and Python Web Development — page spread 3 Django and Python Web Development — page spread 4 Django and Python Web Development — page spread 5 Django and Python Web Development — page spread 6 Django and Python Web Development — page spread 7 Django and Python Web Development — sample page Django and Python Web Development — sample page Django and Python Web Development — sample page

Learn Django from your first view to a deployed production application: projects and apps, URLs and views, templates, models and the ORM, migrations, the admin, forms and ModelForms, class-based views, sessions and messages, authentication and permissions, security and CSP, JSON APIs with plain…

Build Real Web Apps from Models to Deployment

Read before you buy: the PDF here is a free sample — the first 20 pages of the 547-page book (payments, sales and reviews on this demo site are sample data). Get the full e-book at thenexbooks on Gumroad.

Build real web applications with Python, from the first model to a tested production deployment.

Most useful web software has the same shape: people fill in forms, the server checks the input, stores data, sends emails, and enforces rules that must never break. Django was built for exactly that work. It gives you routing, templates, an ORM with migrations, a ready-made admin, forms, authentication, caching, testing tools, and strong security defaults — all designed to work together, all in Python.

This book teaches Django step by step for Python beginners and intermediate developers. You build one complete application throughout, and each feature appears at the moment it solves a real problem, so you learn how to design your own Django projects, not just how to copy snippets.

What's inside

  • How web apps work, setting up Python and a virtual environment, and your first Django project and page
  • Projects and apps, settings, a custom user model from day one, URLs, function-based views, and custom path converters
  • Templates: inheritance, filters and tags, custom template filters, template partials, and static files
  • Models done right: fields, choices, relationships, on_delete choices, constraints, and Decimal for money
  • Migrations: reading, writing, rolling back, and data migrations
  • The ORM in depth: QuerySets, lookups, related objects, aggregation, annotations, F and Q, subqueries, and fixing N+1 queries
  • The Django admin as a real back office: list filters, search, inlines, custom actions, and permissions
  • Forms, ModelForms, formsets, file uploads, and class-based and generic views
  • Business logic in services, transactions, and database constraints that protect your data
  • Signals, management commands, fixtures, sessions, cookies, messages, and middleware
  • Authentication, signup, groups, permissions, and object-level access control
  • Security essentials: CSRF, XSS, clickjacking, SQL injection, HTTPS settings, check --deploy, and Content Security Policy
  • JSON APIs with plain Django: JsonResponse, validation, token authentication, pagination, consistent errors, rate limiting, and CORS
  • A careful overview of Django REST Framework and when it is worth adding
  • Async views and ASGI, caching with Redis, performance, and background tasks with Django's tasks framework
  • Testing with TestCase and the test client, settings for every environment, logging, and email
  • Deployment with PostgreSQL, Gunicorn or Uvicorn, Nginx, systemd, WhiteNoise, Docker, CI, backups, and monitoring

One running example, start to finish. You build the web application for Sunmeadow Veterinary Clinic, a fictional practice with three vets, a front desk, and pet owners who book appointments online. It grows from a hello page into a complete system with owners and pets, appointment slots and bookings with real business rules, visit notes signed by vets, invoices with correct tax and late-cancellation fees, a staff back office, a JSON API, confirmation emails as background tasks, and a production deployment. The sample data is small enough to check by hand, and the shell sessions, query results, and test runs in the book come from running the code.

Current and honest. The book targets Django 6.x on Python 3.12 and newer and was verified with Django 6.1. Features that need a specific release are marked, third-party packages are clearly labeled, and you are pointed to the official release schedule for support dates instead of guesses. It contains no invented benchmarks or statistics. Every chapter includes complete code, Tips, Notes, Warnings, exercises, and Key Takeaways, and the appendices give you a cheat sheet, copy-ready templates (settings, URLs, systemd, Nginx, Dockerfile, CI), a production checklist, and a glossary.

Format: PDF, 547 pages (A4), linked table of contents and bookmarks. English. First Edition, 2026. Published by thenexbooks. Django is a registered trademark of the Django Software Foundation and Python is a registered trademark of the Python Software Foundation; this book is independent and is not affiliated with, sponsored by, or endorsed by either foundation.

Table of Contents

Part I — Getting Started with Django

  • Ch 1 · Why Django? How Web Apps Work and Setting Up Your Environment
  • Ch 2 · Your First Project: startproject, runserver, and a Hello Page
  • Ch 3 · Projects and Apps: Structure, Settings, and the Sunmeadow Plan
  • Ch 4 · URLs and Function-Based Views: Routing Requests to Python
  • Ch 5 · Templates: The Django Template Language, Inheritance, and Static Files

Part II — Data and the ORM

  • Ch 6 · Models: Fields, Choices, Relationships, and Constraints
  • Ch 7 · Migrations: Evolving Your Schema Safely
  • Ch 8 · The ORM in Depth: QuerySets, Lookups, and Related Objects
  • Ch 9 · Advanced Queries: Aggregation, Annotations, F and Q, and Query Performance
  • Ch 10 · The Django Admin: A Back Office for the Front Desk

Part III — Building the Application

  • Ch 11 · Forms: Validation, Rendering, and the Request Cycle
  • Ch 12 · ModelForms, Formsets, and File Uploads
  • Ch 13 · Class-Based Views and Generic Views
  • Ch 14 · The Booking Workflow: Business Rules, Services, and Transactions
  • Ch 15 · Signals, Management Commands, and Fixtures

Part IV — Users, Sessions, and Security

  • Ch 16 · Sessions, Cookies, Messages, and Middleware
  • Ch 17 · Authentication: Custom Users, Login, Logout, and Signup
  • Ch 18 · Permissions, Groups, and Protecting Views and Data
  • Ch 19 · Security Essentials: CSRF, XSS, Clickjacking, CSP, and Safe Settings

Part V — APIs, Async, and Background Work

  • Ch 20 · JSON APIs with Plain Django: JsonResponse, Serialization, and Validation
  • Ch 21 · API Design in Practice: Tokens, Pagination, Errors, and CORS
  • Ch 22 · Django REST Framework: An Overview of the Third-Party Option
  • Ch 23 · Async Views, ASGI, and Real-Time Options
  • Ch 24 · Caching, Performance, and Background Tasks

Part VI — Testing and Production

  • Ch 25 · Testing Django Apps: TestCase, the Test Client, and Test Data
  • Ch 26 · Settings for Every Environment: Configuration, Logging, and Email
  • Ch 27 · Deployment: PostgreSQL, Gunicorn or Uvicorn, Nginx, and Static Files
  • Ch 28 · Case Study: Shipping Sunmeadow — Launch Checklist, Monitoring, and Next Steps

Appendices
A · Django Cheat Sheet
B · Templates and Reference
C · Production Checklist
D · Glossary

Book details

Detail
Pages547
FormatPDF (A4)
LanguageEnglish
LevelBeginner to Intermediate
Edition1st Edition (2026)
Download on this siteFree sample, first 20 pages (PDF)
Publisherthenexbooks

ไฟล์ที่คุณจะได้รับ

PDF
Django-and-Python-Web-Development-Free-Sample.pdf
643.4 KB · เวอร์ชัน 1 · อัปเดต 5 Sep 2026

ยังไม่มีรีวิว เฉพาะผู้ซื้อเท่านั้นที่รีวิวได้

สินค้าอื่นจาก thenexbooks

ไปที่ร้าน
$9.00