[{"data":1,"prerenderedAt":2272},["ShallowReactive",2],{"navigation":3,"/urls-and-views":1016,"/urls-and-views-surround":2267},[4,54,89,123,165,211,253,331,389,439,462,488,514,540,578,624,650,672,702,736,774,800,850,856,862,868,874,928],{"title":5,"path":6,"stem":7,"children":8},"Introduction and Foundations","/introduction-and-foundations","01.introduction-and-foundations/01.index",[9,10,14,18,22,26,30,34,38,42,46,50],{"title":5,"path":6,"stem":7},{"title":11,"path":12,"stem":13},"What is Django","/introduction-and-foundations/what-is-django","01.introduction-and-foundations/02.what-is-django",{"title":15,"path":16,"stem":17},"Key Concepts and Philosophy","/introduction-and-foundations/key-concepts-and-philosophy","01.introduction-and-foundations/03.key-concepts-and-philosophy",{"title":19,"path":20,"stem":21},"MVC vs MVT: Understanding Django's Architecture","/introduction-and-foundations/mvc-vs-mvt","01.introduction-and-foundations/04.mvc-vs-mvt",{"title":23,"path":24,"stem":25},"Project Structure Overview","/introduction-and-foundations/project-structure-overview","01.introduction-and-foundations/05.project-structure-overview",{"title":27,"path":28,"stem":29},"Installing Django","/introduction-and-foundations/installing-django","01.introduction-and-foundations/06.installing-django",{"title":31,"path":32,"stem":33},"Creating Your First Django Project","/introduction-and-foundations/creating-first-project","01.introduction-and-foundations/07.creating-first-project",{"title":35,"path":36,"stem":37},"Creating Your First Django App","/introduction-and-foundations/creating-first-app","01.introduction-and-foundations/08.creating-first-app",{"title":39,"path":40,"stem":41},"Your First Django \"Hello World\"","/introduction-and-foundations/hello-world","01.introduction-and-foundations/09.hello-world",{"title":43,"path":44,"stem":45},"Django Quick Start Guide","/introduction-and-foundations/quick-start-guide","01.introduction-and-foundations/10.quick-start-guide",{"title":47,"path":48,"stem":49},"How Django Handles Requests","/introduction-and-foundations/how-django-handles-requests","01.introduction-and-foundations/11.how-django-handles-requests",{"title":51,"path":52,"stem":53},"Django Settings","/introduction-and-foundations/django-settings","01.introduction-and-foundations/12.django-settings",{"title":55,"path":56,"stem":57,"children":58},"The Development Environment","/development-environment","02.development-environment/1.index",[59,61,65,69,73,77,81,85],{"title":60,"path":56,"stem":57},"Development Environment",{"title":62,"path":63,"stem":64},"Recommended Tooling for Django Development","/development-environment/recommended-tooling","02.development-environment/2.recommended-tooling",{"title":66,"path":67,"stem":68},"Virtual Environments","/development-environment/virtual-environments","02.development-environment/3.virtual-environments",{"title":70,"path":71,"stem":72},"Django Admin and Management Commands","/development-environment/admin-and-management-commands","02.development-environment/4.admin-and-management-commands",{"title":74,"path":75,"stem":76},"Django Project Settings","/development-environment/project-settings","02.development-environment/5.project-settings",{"title":78,"path":79,"stem":80},"Managing Django Environments: Local, Staging, and Production","/development-environment/environments-local-staging-production","02.development-environment/6.environments-local-staging-production",{"title":82,"path":83,"stem":84},"Running Django Development Server","/development-environment/running-development-server","02.development-environment/7.running-development-server",{"title":86,"path":87,"stem":88},"Working with Django Shell","/development-environment/working-with-shell","02.development-environment/8.working-with-shell",{"title":90,"path":91,"stem":92,"children":93},"Templates and Presentation Layer","/templates-and-presentation","03.templates-and-presentation/1.index",[94,95,99,103,107,111,115,119],{"title":90,"path":91,"stem":92},{"title":96,"path":97,"stem":98},"Introduction to Django Templates","/templates-and-presentation/introduction-to-templates","03.templates-and-presentation/2.introduction-to-templates",{"title":100,"path":101,"stem":102},"The Django Template Language","/templates-and-presentation/django-template-language","03.templates-and-presentation/3.django-template-language",{"title":104,"path":105,"stem":106},"Template Inheritance","/templates-and-presentation/template-inheritance","03.templates-and-presentation/4.template-inheritance",{"title":108,"path":109,"stem":110},"Built-in Template Tags and Filters","/templates-and-presentation/built-in-template-tags-and-filters","03.templates-and-presentation/5.built-in-template-tags-and-filters",{"title":112,"path":113,"stem":114},"Including Static Files","/templates-and-presentation/including-static-files","03.templates-and-presentation/6.including-static-files",{"title":116,"path":117,"stem":118},"Working with Media Files","/templates-and-presentation/working-with-media-files","03.templates-and-presentation/7.working-with-media-files",{"title":120,"path":121,"stem":122},"Using Alternative Template Engines","/templates-and-presentation/using-alternative-template-engines","03.templates-and-presentation/8.using-alternative-template-engines",{"title":124,"path":125,"stem":126,"children":127},"URLs and Views","/urls-and-views","04.urls-and-views/01.index",[128,129,133,137,141,145,149,153,157,161],{"title":124,"path":125,"stem":126},{"title":130,"path":131,"stem":132},"The URL Dispatcher","/urls-and-views/the-url-dispatcher","04.urls-and-views/02.the-url-dispatcher",{"title":134,"path":135,"stem":136},"Writing Function-Based Views","/urls-and-views/writing-function-based-views","04.urls-and-views/03.writing-function-based-views",{"title":138,"path":139,"stem":140},"View Decorators","/urls-and-views/view-decorators","04.urls-and-views/04.view-decorators",{"title":142,"path":143,"stem":144},"Rendering Responses","/urls-and-views/rendering-responses","04.urls-and-views/05.rendering-responses",{"title":146,"path":147,"stem":148},"Redirects","/urls-and-views/redirects","04.urls-and-views/06.redirects",{"title":150,"path":151,"stem":152},"Handling HTTP Methods","/urls-and-views/handling-http-methods","04.urls-and-views/07.handling-http-methods",{"title":154,"path":155,"stem":156},"Conditional View Processing","/urls-and-views/conditional-view-processing","04.urls-and-views/08.conditional-view-processing",{"title":158,"path":159,"stem":160},"File Uploads","/urls-and-views/file-uploads","04.urls-and-views/09.file-uploads",{"title":162,"path":163,"stem":164},"Using Django Shortcut Functions","/urls-and-views/using-django-shortcut-functions","04.urls-and-views/10.using-django-shortcut-functions",{"title":166,"path":167,"stem":168,"children":169},"Class Based Views","/class-based-views","05.class-based-views/01.index",[170,171,175,179,183,187,191,195,199,203,207],{"title":166,"path":167,"stem":168},{"title":172,"path":173,"stem":174},"Introduction to Class-Based Views","/class-based-views/introduction-to-class-based-views","05.class-based-views/02.introduction-to-class-based-views",{"title":176,"path":177,"stem":178},"Common Base Classes","/class-based-views/common-base-classes","05.class-based-views/03.common-base-classes",{"title":180,"path":181,"stem":182},"Built-in Generic Views","/class-based-views/built-in-generic-views","05.class-based-views/04.built-in-generic-views",{"title":184,"path":185,"stem":186},"Views for CRUD Operations","/class-based-views/views-for-crud-operations","05.class-based-views/05.views-for-crud-operations",{"title":188,"path":189,"stem":190},"Handling Forms with Class-Based Views","/class-based-views/handling-forms-with-class-based-views","05.class-based-views/06.handling-forms-with-class-based-views",{"title":192,"path":193,"stem":194},"Using Mixins","/class-based-views/using-mixins","05.class-based-views/07.using-mixins",{"title":196,"path":197,"stem":198},"URL Configuration with Class-Based Views","/class-based-views/url-configuration-with-class-based-views","05.class-based-views/08.url-configuration-with-class-based-views",{"title":200,"path":201,"stem":202},"Subclassing Generic Views","/class-based-views/subclassing-generic-views","05.class-based-views/09.subclassing-generic-views",{"title":204,"path":205,"stem":206},"Asynchronous Class-Based Views","/class-based-views/asynchronous-class-based-views","05.class-based-views/10.asynchronous-class-based-views",{"title":208,"path":209,"stem":210},"Pagination","/class-based-views/pagination","05.class-based-views/11.pagination",{"title":212,"path":213,"stem":214,"children":215},"Forms and User Input","/forms-and-user-input","06.forms-and-user-input/01.index",[216,217,221,225,229,233,237,241,245,249],{"title":212,"path":213,"stem":214},{"title":218,"path":219,"stem":220},"Understanding HTML Forms","/forms-and-user-input/understanding-html-forms","06.forms-and-user-input/02.understanding-html-forms",{"title":222,"path":223,"stem":224},"Django's Role in Form Handling","/forms-and-user-input/djangos-role-in-form-handling","06.forms-and-user-input/03.djangos-role-in-form-handling",{"title":226,"path":227,"stem":228},"Creating Forms with Forms API","/forms-and-user-input/creating-forms-with-forms-api","06.forms-and-user-input/04.creating-forms-with-forms-api",{"title":230,"path":231,"stem":232},"Form Validation","/forms-and-user-input/form-validation","06.forms-and-user-input/05.form-validation",{"title":234,"path":235,"stem":236},"Built-in Fields and Widgets","/forms-and-user-input/built-in-fields-and-widgets","06.forms-and-user-input/06.built-in-fields-and-widgets",{"title":238,"path":239,"stem":240},"Form Rendering in Templates","/forms-and-user-input/form-rendering-in-templates","06.forms-and-user-input/07.form-rendering-in-templates",{"title":242,"path":243,"stem":244},"Model Forms","/forms-and-user-input/model-forms","06.forms-and-user-input/08.model-forms",{"title":246,"path":247,"stem":248},"Advanced Form Techniques","/forms-and-user-input/advanced-form-techniques","06.forms-and-user-input/09.advanced-form-techniques",{"title":250,"path":251,"stem":252},"Security Considerations for Forms","/forms-and-user-input/security-considerations-for-forms","06.forms-and-user-input/10.security-considerations-for-forms",{"title":254,"path":255,"stem":256,"children":257},"Models and Databases","/models-and-databases","07.models-and-databases/01.index",[258,259,263,267,271,275,279,283,287,291,295,299,303,307,311,315,319,323,327],{"title":254,"path":255,"stem":256},{"title":260,"path":261,"stem":262},"Understanding Django Models","/models-and-databases/understanding-django-models","07.models-and-databases/02.understanding-django-models",{"title":264,"path":265,"stem":266},"Defining Fields","/models-and-databases/defining-fields","07.models-and-databases/03.defining-fields",{"title":268,"path":269,"stem":270},"Relationships and Foreign Keys","/models-and-databases/relationships-and-foreign-keys","07.models-and-databases/04.relationships-and-foreign-keys",{"title":272,"path":273,"stem":274},"Examples of Relationship Patterns","/models-and-databases/examples-of-relationship-patterns","07.models-and-databases/05.examples-of-relationship-patterns",{"title":276,"path":277,"stem":278},"Making Queries","/models-and-databases/making-queries","07.models-and-databases/06.making-queries",{"title":280,"path":281,"stem":282},"Filtering, Ordering, and Slicing","/models-and-databases/filtering-ordering-slicing","07.models-and-databases/07.filtering-ordering-slicing",{"title":284,"path":285,"stem":286},"Managers and QuerySets","/models-and-databases/managers-and-querysets","07.models-and-databases/08.managers-and-querysets",{"title":288,"path":289,"stem":290},"Aggregation","/models-and-databases/aggregation","07.models-and-databases/09.aggregation",{"title":292,"path":293,"stem":294},"Search","/models-and-databases/search","07.models-and-databases/10.search",{"title":296,"path":297,"stem":298},"Raw SQL Queries","/models-and-databases/raw-sql-queries","07.models-and-databases/11.raw-sql-queries",{"title":300,"path":301,"stem":302},"Transactions","/models-and-databases/transactions","07.models-and-databases/12.transactions",{"title":304,"path":305,"stem":306},"Multiple Databases","/models-and-databases/multiple-databases","07.models-and-databases/13.multiple-databases",{"title":308,"path":309,"stem":310},"Tablespaces","/models-and-databases/tablespaces","07.models-and-databases/14.tablespaces",{"title":312,"path":313,"stem":314},"Composite Primary Keys","/models-and-databases/composite-primary-keys","07.models-and-databases/15.composite-primary-keys",{"title":316,"path":317,"stem":318},"Database Instrumentation","/models-and-databases/database-instrumentation","07.models-and-databases/16.database-instrumentation",{"title":320,"path":321,"stem":322},"Database Optimization","/models-and-databases/database-optimization","07.models-and-databases/17.database-optimization",{"title":324,"path":325,"stem":326},"Fixtures","/models-and-databases/fixtures","07.models-and-databases/18.fixtures",{"title":328,"path":329,"stem":330},"Signals","/models-and-databases/signals","07.models-and-databases/19.signals",{"title":332,"path":333,"stem":334,"children":335},"Migrations","/migrations","08.migrations/01.index",[336,337,341,345,349,353,357,361,365,369,373,377,381,385],{"title":332,"path":333,"stem":334},{"title":338,"path":339,"stem":340},"How Migrations Work","/migrations/how-migrations-work","08.migrations/02.how-migrations-work",{"title":342,"path":343,"stem":344},"Management Commands","/migrations/management-commands","08.migrations/03.management-commands",{"title":346,"path":347,"stem":348},"Dependencies and Workflow","/migrations/dependencies-and-workflow","08.migrations/04.dependencies-and-workflow",{"title":350,"path":351,"stem":352},"Transaction Handling","/migrations/transaction-handling","08.migrations/05.transaction-handling",{"title":354,"path":355,"stem":356},"Adding Migrations to Apps","/migrations/adding-migrations-to-apps","08.migrations/06.adding-migrations-to-apps",{"title":358,"path":359,"stem":360},"Reversing Migrations","/migrations/reversing-migrations","08.migrations/07.reversing-migrations",{"title":362,"path":363,"stem":364},"Historical Models","/migrations/historical-models","08.migrations/08.historical-models",{"title":366,"path":367,"stem":368},"Considerations When Removing Fields","/migrations/considerations-when-removing-fields","08.migrations/09.considerations-when-removing-fields",{"title":370,"path":371,"stem":372},"Data Migrations","/migrations/data-migrations","08.migrations/10.data-migrations",{"title":374,"path":375,"stem":376},"Squashing Migrations","/migrations/squashing-migrations","08.migrations/11.squashing-migrations",{"title":378,"path":379,"stem":380},"Serializing Values","/migrations/serializing-values","08.migrations/12.serializing-values",{"title":382,"path":383,"stem":384},"Supporting Multiple Django Versions","/migrations/supporting-multiple-django-versions","08.migrations/13.supporting-multiple-django-versions",{"title":386,"path":387,"stem":388},"Django Serialization Framework","/migrations/django-serialization-framework","08.migrations/14.django-serialization-framework",{"title":390,"path":391,"stem":392,"children":393},"Authentication and Authorization","/authentication-and-authorization","09.authentication-and-authorization/01.index",[394,395,399,403,407,411,415,419,423,427,431,435],{"title":390,"path":391,"stem":392},{"title":396,"path":397,"stem":398},"Overview of Django's Authentication System","/authentication-and-authorization/overview-of-django-authentication-system","09.authentication-and-authorization/02.overview-of-django-authentication-system",{"title":400,"path":401,"stem":402},"Users and Groups","/authentication-and-authorization/users-and-groups","09.authentication-and-authorization/03.users-and-groups",{"title":404,"path":405,"stem":406},"Permissions","/authentication-and-authorization/permissions","09.authentication-and-authorization/04.permissions",{"title":408,"path":409,"stem":410},"Password Management","/authentication-and-authorization/password-management","09.authentication-and-authorization/05.password-management",{"title":412,"path":413,"stem":414},"Authentication Views","/authentication-and-authorization/authentication-views","09.authentication-and-authorization/06.authentication-views",{"title":416,"path":417,"stem":418},"Login and Logout","/authentication-and-authorization/login-and-logout","09.authentication-and-authorization/07.login-and-logout",{"title":420,"path":421,"stem":422},"Custom User Models","/authentication-and-authorization/custom-user-models","09.authentication-and-authorization/08.custom-user-models",{"title":424,"path":425,"stem":426},"Middleware for Authentication","/authentication-and-authorization/middleware-for-authentication","09.authentication-and-authorization/09.middleware-for-authentication",{"title":428,"path":429,"stem":430},"Authorization in Views and Templates","/authentication-and-authorization/authorization-in-views-and-templates","09.authentication-and-authorization/10.authorization-in-views-and-templates",{"title":432,"path":433,"stem":434},"Integrating Social Authentication","/authentication-and-authorization/integrating-social-authentication","09.authentication-and-authorization/11.integrating-social-authentication",{"title":436,"path":437,"stem":438},"Security Best Practices","/authentication-and-authorization/security-best-practices","09.authentication-and-authorization/12.security-best-practices",{"title":440,"path":441,"stem":442,"children":443},"Sessions, Cookies, and State","/sessions-cookies-state","10.sessions-cookies-state/01.index",[444,446,450,454,458],{"title":445,"path":441,"stem":442},"Sessions, Cookies, and State Management",{"title":447,"path":448,"stem":449},"Introduction to Sessions","/sessions-cookies-state/introduction-to-sessions","10.sessions-cookies-state/02.introduction-to-sessions",{"title":451,"path":452,"stem":453},"Working with Cookies","/sessions-cookies-state/working-with-cookies","10.sessions-cookies-state/03.working-with-cookies",{"title":455,"path":456,"stem":457},"Server-Side Session Storage Options","/sessions-cookies-state/server-side-session-storage-options","10.sessions-cookies-state/04.server-side-session-storage-options",{"title":459,"path":460,"stem":461},"Session Security","/sessions-cookies-state/session-security","10.sessions-cookies-state/05.session-security",{"title":463,"path":464,"stem":465,"children":466},"Working with Files","/working-with-files","11.working-with-files/01.index",[467,468,472,476,480,484],{"title":463,"path":464,"stem":465},{"title":469,"path":470,"stem":471},"Files in Models","/working-with-files/files-in-models","11.working-with-files/02.files-in-models",{"title":473,"path":474,"stem":475},"The File Object","/working-with-files/the-file-object","11.working-with-files/03.the-file-object",{"title":477,"path":478,"stem":479},"Storage Backends","/working-with-files/storage-backends","11.working-with-files/04.storage-backends",{"title":481,"path":482,"stem":483},"Using Cloud Storage Providers","/working-with-files/using-cloud-storage-providers","11.working-with-files/05.using-cloud-storage-providers",{"title":485,"path":486,"stem":487},"Managing Media in Production","/working-with-files/managing-media-in-production","11.working-with-files/06.managing-media-in-production",{"title":489,"path":490,"stem":491,"children":492},"Admin Site","/admin-site","12.admin-site/01.index",[493,494,498,502,506,510],{"title":489,"path":490,"stem":491},{"title":495,"path":496,"stem":497},"Enabling the Admin","/admin-site/enabling-the-admin","12.admin-site/02.enabling-the-admin",{"title":499,"path":500,"stem":501},"Registering Models","/admin-site/registering-models","12.admin-site/03.registering-models",{"title":503,"path":504,"stem":505},"Customizing Admin Display","/admin-site/customizing-admin-display","12.admin-site/04.customizing-admin-display",{"title":507,"path":508,"stem":509},"Admin Actions","/admin-site/admin-actions","12.admin-site/05.admin-actions",{"title":511,"path":512,"stem":513},"Admin Security Best Practices","/admin-site/admin-security-best-practices","12.admin-site/06.admin-security-best-practices",{"title":515,"path":516,"stem":517,"children":518},"Middleware","/middleware","13.middleware/01.index",[519,520,524,528,532,536],{"title":515,"path":516,"stem":517},{"title":521,"path":522,"stem":523},"Middleware Overview","/middleware/middleware-overview","13.middleware/02.middleware-overview",{"title":525,"path":526,"stem":527},"Built-in Middleware","/middleware/built-in-middleware","13.middleware/03.built-in-middleware",{"title":529,"path":530,"stem":531},"Creating Custom Middleware","/middleware/creating-custom-middleware","13.middleware/04.creating-custom-middleware",{"title":533,"path":534,"stem":535},"Middleware Ordering","/middleware/middleware-ordering","13.middleware/05.middleware-ordering",{"title":537,"path":538,"stem":539},"Performance and Debugging","/middleware/performance-and-debugging","13.middleware/06.performance-and-debugging",{"title":541,"path":542,"stem":543,"children":544},"Security","/security","14.security/01.index",[545,546,550,554,558,562,566,570,574],{"title":541,"path":542,"stem":543},{"title":547,"path":548,"stem":549},"Django Security Philosophy","/security/django-security-philosophy","14.security/02.django-security-philosophy",{"title":551,"path":552,"stem":553},"Cross Site Request Forgery","/security/cross-site-request-forgery","14.security/03.cross-site-request-forgery",{"title":555,"path":556,"stem":557},"Cross Site Scripting","/security/cross-site-scripting","14.security/04.cross-site-scripting",{"title":559,"path":560,"stem":561},"SQL Injection Protection","/security/sql-injection-protection","14.security/05.sql-injection-protection",{"title":563,"path":564,"stem":565},"Clickjacking Protection","/security/clickjacking-protection","14.security/06.clickjacking-protection",{"title":567,"path":568,"stem":569},"HTTPS Setup and HSTS","/security/https-setup-and-hsts","14.security/07.https-setup-and-hsts",{"title":571,"path":572,"stem":573},"Password Storage and Cryptography","/security/password-storage-and-cryptography","14.security/08.password-storage-and-cryptography",{"title":575,"path":576,"stem":577},"Secure Deployment Checklist","/security/secure-deployment-checklist","14.security/09.secure-deployment-checklist",{"title":579,"path":580,"stem":581,"children":582},"Testing","/testing","15.testing/01.index",[583,584,588,592,596,600,604,608,612,616,620],{"title":579,"path":580,"stem":581},{"title":585,"path":586,"stem":587},"Introduction to Django Testing","/testing/introduction-to-django-testing","15.testing/02.introduction-to-django-testing",{"title":589,"path":590,"stem":591},"Writing and Running Tests","/testing/writing-and-running-tests","15.testing/03.writing-and-running-tests",{"title":593,"path":594,"stem":595},"Test Tools","/testing/test-tools","15.testing/04.test-tools",{"title":597,"path":598,"stem":599},"Testing Models","/testing/testing-models","15.testing/05.testing-models",{"title":601,"path":602,"stem":603},"Testing Views","/testing/testing-views","15.testing/06.testing-views",{"title":605,"path":606,"stem":607},"Testing Forms","/testing/testing-forms","15.testing/07.testing-forms",{"title":609,"path":610,"stem":611},"Testing Templates","/testing/testing-templates","15.testing/08.testing-templates",{"title":613,"path":614,"stem":615},"Testing Authentication","/testing/testing-authentication","15.testing/09.testing-authentication",{"title":617,"path":618,"stem":619},"Advanced Testing Topics","/testing/advanced-testing-topics","15.testing/10.advanced-testing-topics",{"title":621,"path":622,"stem":623},"Performance Testing","/testing/performance-testing","15.testing/11.performance-testing",{"title":625,"path":626,"stem":627,"children":628},"Static Assets and Frontend Integration","/static-assets-and-frontend-integration","16.static-assets-and-frontend-integration/01.index",[629,630,634,638,642,646],{"title":625,"path":626,"stem":627},{"title":631,"path":632,"stem":633},"Working with Static Files","/static-assets-and-frontend-integration/working-with-static-files","16.static-assets-and-frontend-integration/02.working-with-static-files",{"title":635,"path":636,"stem":637},"Integrating CSS and JavaScript","/static-assets-and-frontend-integration/integrating-css-and-javascript","16.static-assets-and-frontend-integration/03.integrating-css-and-javascript",{"title":639,"path":640,"stem":641},"Using Build Tools like Vite or Webpack","/static-assets-and-frontend-integration/using-build-tools-like-vite-or-webpack","16.static-assets-and-frontend-integration/04.using-build-tools-like-vite-or-webpack",{"title":643,"path":644,"stem":645},"Using React or Vue with Django","/static-assets-and-frontend-integration/using-react-or-vue-with-django","16.static-assets-and-frontend-integration/05.using-react-or-vue-with-django",{"title":647,"path":648,"stem":649},"Managing CORS","/static-assets-and-frontend-integration/managing-cors","16.static-assets-and-frontend-integration/06.managing-cors",{"title":651,"path":652,"stem":653,"children":654},"Internationalization and Localization","/internationalization-and-localization","17.internationalization-and-localization/01.index",[655,656,660,664,668],{"title":651,"path":652,"stem":653},{"title":657,"path":658,"stem":659},"Enabling Translation","/internationalization-and-localization/enabling-translation","17.internationalization-and-localization/02.enabling-translation",{"title":661,"path":662,"stem":663},"Translating Text in Code and Templates","/internationalization-and-localization/translating-text-in-code-and-templates","17.internationalization-and-localization/03.translating-text-in-code-and-templates",{"title":665,"path":666,"stem":667},"Timezone Support","/internationalization-and-localization/timezone-support","17.internationalization-and-localization/04.timezone-support",{"title":669,"path":670,"stem":671},"Locale Middleware","/internationalization-and-localization/locale-middleware","17.internationalization-and-localization/05.locale-middleware",{"title":673,"path":674,"stem":675,"children":676},"Caching","/caching","18.caching/01.index",[677,678,682,686,690,694,698],{"title":673,"path":674,"stem":675},{"title":679,"path":680,"stem":681},"Introduction to Caching","/caching/introduction-to-caching","18.caching/02.introduction-to-caching",{"title":683,"path":684,"stem":685},"Cache Backends","/caching/cache-backends","18.caching/03.cache-backends",{"title":687,"path":688,"stem":689},"Per View Caching","/caching/per-view-caching","18.caching/04.per-view-caching",{"title":691,"path":692,"stem":693},"Low Level Cache API","/caching/low-level-cache-api","18.caching/05.low-level-cache-api",{"title":695,"path":696,"stem":697},"Template Fragment Caching","/caching/template-fragment-caching","18.caching/06.template-fragment-caching",{"title":699,"path":700,"stem":701},"Deployment Level Caching Patterns","/caching/deployment-level-caching-patterns","18.caching/07.deployment-level-caching-patterns",{"title":703,"path":704,"stem":705,"children":706},"Asynchronous Django","/asynchronous-django","19.asynchronous-django/01.index",[707,708,712,716,720,724,728,732],{"title":703,"path":704,"stem":705},{"title":709,"path":710,"stem":711},"Introduction to ASGI","/asynchronous-django/introduction-to-asgi","19.asynchronous-django/02.introduction-to-asgi",{"title":713,"path":714,"stem":715},"Async Views","/asynchronous-django/async-views","19.asynchronous-django/03.async-views",{"title":717,"path":718,"stem":719},"Async ORM Status","/asynchronous-django/async-orm-status","19.asynchronous-django/04.async-orm-status",{"title":721,"path":722,"stem":723},"WebSockets with Channels","/asynchronous-django/websockets-with-channels","19.asynchronous-django/05.websockets-with-channels",{"title":725,"path":726,"stem":727},"Background Tasks with Celery or RQ","/asynchronous-django/background-tasks-with-celery-or-rq","19.asynchronous-django/06.background-tasks-with-celery-or-rq",{"title":729,"path":730,"stem":731},"Asynchronous Support","/asynchronous-django/asynchronous-support","19.asynchronous-django/07.asynchronous-support",{"title":733,"path":734,"stem":735},"Django's Tasks Framework","/asynchronous-django/django-tasks-framework","19.asynchronous-django/08.django-tasks-framework",{"title":737,"path":738,"stem":739,"children":740},"Deployment","/deployment","20.deployment/01.index",[741,742,746,750,754,758,762,766,770],{"title":737,"path":738,"stem":739},{"title":743,"path":744,"stem":745},"Preparing for Production","/deployment/preparing-for-production","20.deployment/02.preparing-for-production",{"title":747,"path":748,"stem":749},"Using WSGI and ASGI Servers","/deployment/using-wsgi-and-asgi-servers","20.deployment/03.using-wsgi-and-asgi-servers",{"title":751,"path":752,"stem":753},"Deploying on Linux Servers","/deployment/deploying-on-linux-servers","20.deployment/04.deploying-on-linux-servers",{"title":755,"path":756,"stem":757},"Using Docker","/deployment/using-docker","20.deployment/05.using-docker",{"title":759,"path":760,"stem":761},"Cloud Deployment Guides","/deployment/cloud-deployment-guides","20.deployment/06.cloud-deployment-guides",{"title":763,"path":764,"stem":765},"Scaling and Load Balancing","/deployment/scaling-and-load-balancing","20.deployment/07.scaling-and-load-balancing",{"title":767,"path":768,"stem":769},"Monitoring and Logging","/deployment/monitoring-and-logging","20.deployment/08.monitoring-and-logging",{"title":771,"path":772,"stem":773},"Backup Strategies","/deployment/backup-strategies","20.deployment/09.backup-strategies",{"title":775,"path":776,"stem":777,"children":778},"Performance and Optimization","/performance-and-optimization","21.performance-and-optimization/01.index",[779,780,784,788,792,796],{"title":775,"path":776,"stem":777},{"title":781,"path":782,"stem":783},"Query Optimization","/performance-and-optimization/query-optimization","21.performance-and-optimization/02.query-optimization",{"title":785,"path":786,"stem":787},"Template Rendering Optimization","/performance-and-optimization/template-rendering-optimization","21.performance-and-optimization/03.template-rendering-optimization",{"title":789,"path":790,"stem":791},"Using Select Related and Prefetch Related","/performance-and-optimization/using-select-related-and-prefetch-related","21.performance-and-optimization/04.using-select-related-and-prefetch-related",{"title":793,"path":794,"stem":795},"Caching Strategies","/performance-and-optimization/caching-strategies","21.performance-and-optimization/05.caching-strategies",{"title":797,"path":798,"stem":799},"Profiling Django Apps","/performance-and-optimization/profiling-django-apps","21.performance-and-optimization/06.profiling-django-apps",{"title":801,"path":802,"stem":803,"children":804},"Advanced and Expert Topics","/advanced-and-expert-topics","22.advanced-and-expert-topics/01.index",[805,806,810,814,818,822,826,830,834,838,842,846],{"title":801,"path":802,"stem":803},{"title":807,"path":808,"stem":809},"System Architecture Patterns","/advanced-and-expert-topics/system-architecture-patterns","22.advanced-and-expert-topics/02.system-architecture-patterns",{"title":811,"path":812,"stem":813},"Domain Driven Design with Django","/advanced-and-expert-topics/domain-driven-design-with-django","22.advanced-and-expert-topics/03.domain-driven-design-with-django",{"title":815,"path":816,"stem":817},"Building Large Scale Django Projects","/advanced-and-expert-topics/building-large-scale-django-projects","22.advanced-and-expert-topics/04.building-large-scale-django-projects",{"title":819,"path":820,"stem":821},"Plugin Architectures for Django Apps","/advanced-and-expert-topics/plugin-architectures-for-django-apps","22.advanced-and-expert-topics/05.plugin-architectures-for-django-apps",{"title":823,"path":824,"stem":825},"Extending Django's Core","/advanced-and-expert-topics/extending-djangos-core","22.advanced-and-expert-topics/06.extending-djangos-core",{"title":827,"path":828,"stem":829},"Custom ORM Expressions","/advanced-and-expert-topics/custom-orm-expressions","22.advanced-and-expert-topics/07.custom-orm-expressions",{"title":831,"path":832,"stem":833},"Custom Management Commands","/advanced-and-expert-topics/custom-management-commands","22.advanced-and-expert-topics/08.custom-management-commands",{"title":835,"path":836,"stem":837},"Working with Signals","/advanced-and-expert-topics/working-with-signals","22.advanced-and-expert-topics/09.working-with-signals",{"title":839,"path":840,"stem":841},"Building Reusable Django Packages","/advanced-and-expert-topics/building-reusable-django-packages","22.advanced-and-expert-topics/10.building-reusable-django-packages",{"title":843,"path":844,"stem":845},"Integrating Microservices","/advanced-and-expert-topics/integrating-microservices","22.advanced-and-expert-topics/11.integrating-microservices",{"title":847,"path":848,"stem":849},"Advanced Security Hardening","/advanced-and-expert-topics/advanced-security-hardening","22.advanced-and-expert-topics/12.advanced-security-hardening",{"title":851,"path":852,"stem":853,"children":854},"Logging in Django","/logging-in-django","23.logging-in-django/01.index",[855],{"title":851,"path":852,"stem":853},{"title":857,"path":858,"stem":859,"children":860},"FAQ and Troubleshooting","/faq-and-troubleshooting","24.faq-and-troubleshooting/01.index",[861],{"title":857,"path":858,"stem":859},{"title":863,"path":864,"stem":865,"children":866},"External Packages and Ecosystem","/external-packages-and-ecosystem","25.external-packages-and-ecosystem/01.index",[867],{"title":863,"path":864,"stem":865},{"title":869,"path":870,"stem":871,"children":872},"Django Internals and Contributing","/django-internals-and-contributing","26.django-internals-and-contributing/01.index",[873],{"title":869,"path":870,"stem":871},{"title":875,"path":876,"stem":877,"children":878},"Microservices with Django","/microservices-with-django","27.microservices-with-django/01.index",[879,880,884,888,892,896,900,904,908,912,916,920,924],{"title":875,"path":876,"stem":877},{"title":881,"path":882,"stem":883},"What Is a Microservice?","/microservices-with-django/what-is-a-microservice","27.microservices-with-django/02.what-is-a-microservice",{"title":885,"path":886,"stem":887},"Introducing the Django Microservices Architecture","/microservices-with-django/django-microservices-architecture","27.microservices-with-django/03.django-microservices-architecture",{"title":889,"path":890,"stem":891},"Setting Up the Development and Runtime Environment","/microservices-with-django/development-environment","27.microservices-with-django/04.development-environment",{"title":893,"path":894,"stem":895},"Cloud-native Data Processing with MongoDB","/microservices-with-django/cloud-native-data-processing","27.microservices-with-django/05.cloud-native-data-processing",{"title":897,"path":898,"stem":899},"Creating RESTful APIs for Microservices","/microservices-with-django/restful-apis","27.microservices-with-django/06.restful-apis",{"title":901,"path":902,"stem":903},"Orchestrating Microservices with Celery and RabbitMQ","/microservices-with-django/orchestrating-celery-rabbitmq","27.microservices-with-django/07.orchestrating-celery-rabbitmq",{"title":905,"path":906,"stem":907},"Testing Microservices","/microservices-with-django/testing-microservices","27.microservices-with-django/08.testing-microservices",{"title":909,"path":910,"stem":911},"Deploying Microservices","/microservices-with-django/deploying-microservices","27.microservices-with-django/09.deploying-microservices",{"title":913,"path":914,"stem":915},"Securing Microservices","/microservices-with-django/securing-microservices","27.microservices-with-django/10.securing-microservices",{"title":917,"path":918,"stem":919},"Improving Microservices Performance with Caching","/microservices-with-django/performance-caching","27.microservices-with-django/11.performance-caching",{"title":921,"path":922,"stem":923},"Best Practices","/microservices-with-django/best-practices","27.microservices-with-django/12.best-practices",{"title":925,"path":926,"stem":927},"Transforming a Monolithic Web App into a Microservice version","/microservices-with-django/monolith-to-microservices","27.microservices-with-django/13.monolith-to-microservices",{"title":929,"path":930,"stem":931,"children":932},"Releases","/releases","releases",[933,936,940,944,948,952,956,960,964,968,972,976,980,984,988,992,996,1000,1004,1008,1012],{"title":934,"path":930,"stem":935},"Django Releases","releases/index",{"title":937,"path":938,"stem":939},"Django 5.1.10 release notes","/releases/5.1.10","releases/5.1.10",{"title":941,"path":942,"stem":943},"Django 5.1.11 release notes","/releases/5.1.11","releases/5.1.11",{"title":945,"path":946,"stem":947},"Django 5.1.12 release notes","/releases/5.1.12","releases/5.1.12",{"title":949,"path":950,"stem":951},"Django 5.1.13 release notes","/releases/5.1.13","releases/5.1.13",{"title":953,"path":954,"stem":955},"Django 5.1.14 release notes","/releases/5.1.14","releases/5.1.14",{"title":957,"path":958,"stem":959},"Django 5.1.15 release notes","/releases/5.1.15","releases/5.1.15",{"title":961,"path":962,"stem":963},"Django 5.2 release notes","/releases/5.2","releases/5.2",{"title":965,"path":966,"stem":967},"Django 5.2.1 release notes","/releases/5.2.1","releases/5.2.1",{"title":969,"path":970,"stem":971},"Django 5.2.10 release notes","/releases/5.2.10","releases/5.2.10",{"title":973,"path":974,"stem":975},"Django 5.2.2 release notes","/releases/5.2.2","releases/5.2.2",{"title":977,"path":978,"stem":979},"Django 5.2.3 release notes","/releases/5.2.3","releases/5.2.3",{"title":981,"path":982,"stem":983},"Django 5.2.4 release notes","/releases/5.2.4","releases/5.2.4",{"title":985,"path":986,"stem":987},"Django 5.2.5 release notes","/releases/5.2.5","releases/5.2.5",{"title":989,"path":990,"stem":991},"Django 5.2.6 release notes","/releases/5.2.6","releases/5.2.6",{"title":993,"path":994,"stem":995},"Django 5.2.7 release notes","/releases/5.2.7","releases/5.2.7",{"title":997,"path":998,"stem":999},"Django 5.2.8 release notes","/releases/5.2.8","releases/5.2.8",{"title":1001,"path":1002,"stem":1003},"Django 5.2.9 release notes","/releases/5.2.9","releases/5.2.9",{"title":1005,"path":1006,"stem":1007},"Django 6.0 release notes","/releases/6.0","releases/6.0",{"title":1009,"path":1010,"stem":1011},"Django 6.0.1 release notes","/releases/6.0.1","releases/6.0.1",{"title":1013,"path":1014,"stem":1015},"Django 6.1 release notes - UNDER DEVELOPMENT","/releases/6.1","releases/6.1",{"id":1017,"title":124,"body":1018,"description":1028,"extension":2262,"links":2263,"meta":2264,"navigation":1289,"path":125,"seo":2265,"stem":126,"__hash__":2266},"docs/04.urls-and-views/01.index.md",{"type":1019,"value":1020,"toc":2226},"minimark",[1021,1025,1029,1034,1039,1050,1054,1060,1076,1081,1095,1100,1114,1118,1122,1420,1424,1429,1440,1445,1456,1461,1472,1476,1480,1485,1499,1504,1518,1522,1527,1541,1546,1560,1565,1579,1583,1587,1596,1600,1613,1617,1630,1634,1648,1652,1656,1670,1674,1688,1692,1706,1710,1714,1741,1745,1771,1775,1799,1803,1806,1824,1827,1830,1834,1838,1976,1980,2085,2089,2219,2222],[1022,1023,124],"h1",{"id":1024},"urls-and-views",[1026,1027,1028],"p",{},"Django's URL dispatcher and view system form the core of request handling in web applications. This chapter covers everything from basic URL patterns to advanced view techniques, providing the foundation for building robust, scalable web applications.",[1030,1031,1033],"h2",{"id":1032},"the-request-response-cycle","The Request-Response Cycle",[1035,1036,1038],"h3",{"id":1037},"how-django-processes-requests","How Django Processes Requests",[1040,1041,1046],"pre",{"className":1042,"code":1044,"language":1045},[1043],"language-text","1. URL Resolution → 2. View Execution → 3. Response Generation\n   ↓                   ↓                  ↓\nFind URL Pattern    Execute View       Return HttpResponse\nMatch Parameters    Process Logic      Render Template\nCall View Function  Handle Data        Send to Browser\n","text",[1047,1048,1044],"code",{"__ignoreMap":1049},"",[1035,1051,1053],{"id":1052},"core-components","Core Components",[1026,1055,1056],{},[1057,1058,1059],"strong",{},"URL Dispatcher",[1061,1062,1063,1067,1070,1073],"ul",{},[1064,1065,1066],"li",{},"Pattern matching system",[1064,1068,1069],{},"Parameter extraction",[1064,1071,1072],{},"Namespace organization",[1064,1074,1075],{},"Reverse URL resolution",[1026,1077,1078],{},[1057,1079,1080],{},"View Functions",[1061,1082,1083,1086,1089,1092],{},[1064,1084,1085],{},"Request processing logic",[1064,1087,1088],{},"Business logic implementation",[1064,1090,1091],{},"Response generation",[1064,1093,1094],{},"Error handling",[1026,1096,1097],{},[1057,1098,1099],{},"HTTP Handling",[1061,1101,1102,1105,1108,1111],{},[1064,1103,1104],{},"Method-specific processing",[1064,1106,1107],{},"Request data access",[1064,1109,1110],{},"Response customization",[1064,1112,1113],{},"Status code management",[1030,1115,1117],{"id":1116},"url-system-architecture","URL System Architecture",[1035,1119,1121],{"id":1120},"url-configuration-hierarchy","URL Configuration Hierarchy",[1040,1123,1127],{"className":1124,"code":1125,"language":1126,"meta":1049,"style":1049},"language-python shiki shiki-themes material-theme-lighter vitesse-light vitesse-dark","# Project-level URLs (myproject/urls.py)\nurlpatterns = [\n    path('admin/', admin.site.urls),\n    path('blog/', include('blog.urls')),\n    path('api/', include('api.urls')),\n    path('', include('core.urls')),\n]\n\n# App-level URLs (blog/urls.py)\nurlpatterns = [\n    path('', views.post_list, name='post_list'),\n    path('\u003Cint:pk>/', views.post_detail, name='post_detail'),\n    path('create/', views.post_create, name='post_create'),\n]\n","python",[1047,1128,1129,1138,1152,1193,1224,1253,1278,1284,1291,1297,1306,1341,1378,1415],{"__ignoreMap":1049},[1130,1131,1134],"span",{"class":1132,"line":1133},"line",1,[1130,1135,1137],{"class":1136},"s9Tkl","# Project-level URLs (myproject/urls.py)\n",[1130,1139,1141,1145,1149],{"class":1132,"line":1140},2,[1130,1142,1144],{"class":1143},"sftqT","urlpatterns ",[1130,1146,1148],{"class":1147},"soVBu","=",[1130,1150,1151],{"class":1147}," [\n",[1130,1153,1155,1159,1162,1166,1170,1172,1175,1178,1181,1185,1187,1190],{"class":1132,"line":1154},3,[1130,1156,1158],{"class":1157},"siWMO","    path",[1130,1160,1161],{"class":1147},"(",[1130,1163,1165],{"class":1164},"sbYkP","'",[1130,1167,1169],{"class":1168},"sTbE_","admin/",[1130,1171,1165],{"class":1164},[1130,1173,1174],{"class":1147},",",[1130,1176,1177],{"class":1157}," admin",[1130,1179,1180],{"class":1147},".",[1130,1182,1184],{"class":1183},"sBPpx","site",[1130,1186,1180],{"class":1147},[1130,1188,1189],{"class":1183},"urls",[1130,1191,1192],{"class":1147},"),\n",[1130,1194,1196,1198,1200,1202,1205,1207,1209,1212,1214,1216,1219,1221],{"class":1132,"line":1195},4,[1130,1197,1158],{"class":1157},[1130,1199,1161],{"class":1147},[1130,1201,1165],{"class":1164},[1130,1203,1204],{"class":1168},"blog/",[1130,1206,1165],{"class":1164},[1130,1208,1174],{"class":1147},[1130,1210,1211],{"class":1157}," include",[1130,1213,1161],{"class":1147},[1130,1215,1165],{"class":1164},[1130,1217,1218],{"class":1168},"blog.urls",[1130,1220,1165],{"class":1164},[1130,1222,1223],{"class":1147},")),\n",[1130,1225,1227,1229,1231,1233,1236,1238,1240,1242,1244,1246,1249,1251],{"class":1132,"line":1226},5,[1130,1228,1158],{"class":1157},[1130,1230,1161],{"class":1147},[1130,1232,1165],{"class":1164},[1130,1234,1235],{"class":1168},"api/",[1130,1237,1165],{"class":1164},[1130,1239,1174],{"class":1147},[1130,1241,1211],{"class":1157},[1130,1243,1161],{"class":1147},[1130,1245,1165],{"class":1164},[1130,1247,1248],{"class":1168},"api.urls",[1130,1250,1165],{"class":1164},[1130,1252,1223],{"class":1147},[1130,1254,1256,1258,1260,1263,1265,1267,1269,1271,1274,1276],{"class":1132,"line":1255},6,[1130,1257,1158],{"class":1157},[1130,1259,1161],{"class":1147},[1130,1261,1262],{"class":1164},"''",[1130,1264,1174],{"class":1147},[1130,1266,1211],{"class":1157},[1130,1268,1161],{"class":1147},[1130,1270,1165],{"class":1164},[1130,1272,1273],{"class":1168},"core.urls",[1130,1275,1165],{"class":1164},[1130,1277,1223],{"class":1147},[1130,1279,1281],{"class":1132,"line":1280},7,[1130,1282,1283],{"class":1147},"]\n",[1130,1285,1287],{"class":1132,"line":1286},8,[1130,1288,1290],{"emptyLinePlaceholder":1289},true,"\n",[1130,1292,1294],{"class":1132,"line":1293},9,[1130,1295,1296],{"class":1136},"# App-level URLs (blog/urls.py)\n",[1130,1298,1300,1302,1304],{"class":1132,"line":1299},10,[1130,1301,1144],{"class":1143},[1130,1303,1148],{"class":1147},[1130,1305,1151],{"class":1147},[1130,1307,1309,1311,1313,1315,1317,1320,1322,1325,1327,1331,1333,1335,1337,1339],{"class":1132,"line":1308},11,[1130,1310,1158],{"class":1157},[1130,1312,1161],{"class":1147},[1130,1314,1262],{"class":1164},[1130,1316,1174],{"class":1147},[1130,1318,1319],{"class":1157}," views",[1130,1321,1180],{"class":1147},[1130,1323,1324],{"class":1183},"post_list",[1130,1326,1174],{"class":1147},[1130,1328,1330],{"class":1329},"sqOPj"," name",[1130,1332,1148],{"class":1147},[1130,1334,1165],{"class":1164},[1130,1336,1324],{"class":1168},[1130,1338,1165],{"class":1164},[1130,1340,1192],{"class":1147},[1130,1342,1344,1346,1348,1350,1353,1355,1357,1359,1361,1364,1366,1368,1370,1372,1374,1376],{"class":1132,"line":1343},12,[1130,1345,1158],{"class":1157},[1130,1347,1161],{"class":1147},[1130,1349,1165],{"class":1164},[1130,1351,1352],{"class":1168},"\u003Cint:pk>/",[1130,1354,1165],{"class":1164},[1130,1356,1174],{"class":1147},[1130,1358,1319],{"class":1157},[1130,1360,1180],{"class":1147},[1130,1362,1363],{"class":1183},"post_detail",[1130,1365,1174],{"class":1147},[1130,1367,1330],{"class":1329},[1130,1369,1148],{"class":1147},[1130,1371,1165],{"class":1164},[1130,1373,1363],{"class":1168},[1130,1375,1165],{"class":1164},[1130,1377,1192],{"class":1147},[1130,1379,1381,1383,1385,1387,1390,1392,1394,1396,1398,1401,1403,1405,1407,1409,1411,1413],{"class":1132,"line":1380},13,[1130,1382,1158],{"class":1157},[1130,1384,1161],{"class":1147},[1130,1386,1165],{"class":1164},[1130,1388,1389],{"class":1168},"create/",[1130,1391,1165],{"class":1164},[1130,1393,1174],{"class":1147},[1130,1395,1319],{"class":1157},[1130,1397,1180],{"class":1147},[1130,1399,1400],{"class":1183},"post_create",[1130,1402,1174],{"class":1147},[1130,1404,1330],{"class":1329},[1130,1406,1148],{"class":1147},[1130,1408,1165],{"class":1164},[1130,1410,1400],{"class":1168},[1130,1412,1165],{"class":1164},[1130,1414,1192],{"class":1147},[1130,1416,1418],{"class":1132,"line":1417},14,[1130,1419,1283],{"class":1147},[1035,1421,1423],{"id":1422},"url-pattern-types","URL Pattern Types",[1026,1425,1426],{},[1057,1427,1428],{},"Static Patterns",[1061,1430,1431,1434,1437],{},[1064,1432,1433],{},"Fixed URL segments",[1064,1435,1436],{},"Exact string matching",[1064,1438,1439],{},"Simple routing",[1026,1441,1442],{},[1057,1443,1444],{},"Dynamic Patterns",[1061,1446,1447,1450,1453],{},[1064,1448,1449],{},"Parameter capture",[1064,1451,1452],{},"Type conversion",[1064,1454,1455],{},"Flexible routing",[1026,1457,1458],{},[1057,1459,1460],{},"Regular Expression Patterns",[1061,1462,1463,1466,1469],{},[1064,1464,1465],{},"Complex pattern matching",[1064,1467,1468],{},"Advanced parameter extraction",[1064,1470,1471],{},"Legacy compatibility",[1030,1473,1475],{"id":1474},"view-system-overview","View System Overview",[1035,1477,1479],{"id":1478},"function-based-views-fbvs","Function-Based Views (FBVs)",[1026,1481,1482],{},[1057,1483,1484],{},"Characteristics:",[1061,1486,1487,1490,1493,1496],{},[1064,1488,1489],{},"Simple, straightforward approach",[1064,1491,1492],{},"Direct request handling",[1064,1494,1495],{},"Explicit control flow",[1064,1497,1498],{},"Easy to understand and debug",[1026,1500,1501],{},[1057,1502,1503],{},"Best For:",[1061,1505,1506,1509,1512,1515],{},[1064,1507,1508],{},"Simple operations",[1064,1510,1511],{},"Custom logic requirements",[1064,1513,1514],{},"Learning Django concepts",[1064,1516,1517],{},"Rapid prototyping",[1035,1519,1521],{"id":1520},"view-responsibilities","View Responsibilities",[1026,1523,1524],{},[1057,1525,1526],{},"Request Processing",[1061,1528,1529,1532,1535,1538],{},[1064,1530,1531],{},"Parse incoming data",[1064,1533,1534],{},"Validate parameters",[1064,1536,1537],{},"Handle authentication",[1064,1539,1540],{},"Process business logic",[1026,1542,1543],{},[1057,1544,1545],{},"Response Generation",[1061,1547,1548,1551,1554,1557],{},[1064,1549,1550],{},"Render templates",[1064,1552,1553],{},"Return JSON/XML",[1064,1555,1556],{},"Handle redirects",[1064,1558,1559],{},"Manage errors",[1026,1561,1562],{},[1057,1563,1564],{},"Data Management",[1061,1566,1567,1570,1573,1576],{},[1064,1568,1569],{},"Database queries",[1064,1571,1572],{},"Form processing",[1064,1574,1575],{},"File handling",[1064,1577,1578],{},"Session management",[1030,1580,1582],{"id":1581},"what-youll-learn","What You'll Learn",[1035,1584,1586],{"id":1585},"url-configuration","URL Configuration",[1026,1588,1589,1591,1592,1595],{},[1057,1590,130],{}," - Pattern matching, parameter extraction, and URL organization\n",[1057,1593,1594],{},"Advanced Routing"," - Namespaces, includes, and complex pattern matching",[1035,1597,1599],{"id":1598},"view-development","View Development",[1026,1601,1602,1605,1606,1608,1609,1612],{},[1057,1603,1604],{},"Function-Based Views"," - Request handling, response generation, and business logic\n",[1057,1607,138],{}," - Authentication, caching, and request modification\n",[1057,1610,1611],{},"HTTP Methods"," - GET, POST, PUT, DELETE handling and RESTful patterns",[1035,1614,1616],{"id":1615},"response-handling","Response Handling",[1026,1618,1619,1621,1622,1625,1626,1629],{},[1057,1620,142],{}," - Templates, JSON, and custom content types\n",[1057,1623,1624],{},"Redirects and Errors"," - Status codes, error pages, and user flow\n",[1057,1627,1628],{},"File Operations"," - Uploads, downloads, and media handling",[1035,1631,1633],{"id":1632},"advanced-techniques","Advanced Techniques",[1026,1635,1636,1639,1640,1643,1644,1647],{},[1057,1637,1638],{},"Shortcut Functions"," - Django helpers for common operations\n",[1057,1641,1642],{},"Custom Decorators"," - Reusable view enhancements\n",[1057,1645,1646],{},"Performance Optimization"," - Caching, database optimization, and scaling",[1030,1649,1651],{"id":1650},"real-world-applications","Real-World Applications",[1035,1653,1655],{"id":1654},"content-management","Content Management",[1061,1657,1658,1661,1664,1667],{},[1064,1659,1660],{},"Blog systems with dynamic URLs",[1064,1662,1663],{},"News sites with category routing",[1064,1665,1666],{},"Documentation with hierarchical URLs",[1064,1668,1669],{},"E-commerce product catalogs",[1035,1671,1673],{"id":1672},"api-development","API Development",[1061,1675,1676,1679,1682,1685],{},[1064,1677,1678],{},"RESTful API endpoints",[1064,1680,1681],{},"JSON response handling",[1064,1683,1684],{},"Authentication integration",[1064,1686,1687],{},"Rate limiting and throttling",[1035,1689,1691],{"id":1690},"user-interactions","User Interactions",[1061,1693,1694,1697,1700,1703],{},[1064,1695,1696],{},"Form processing workflows",[1064,1698,1699],{},"File upload systems",[1064,1701,1702],{},"Search and filtering",[1064,1704,1705],{},"Pagination and navigation",[1030,1707,1709],{"id":1708},"development-patterns","Development Patterns",[1035,1711,1713],{"id":1712},"url-design-principles","URL Design Principles",[1715,1716,1717,1723,1729,1735],"ol",{},[1064,1718,1719,1722],{},[1057,1720,1721],{},"Predictable"," - Consistent naming and structure",[1064,1724,1725,1728],{},[1057,1726,1727],{},"Readable"," - Human-friendly URLs",[1064,1730,1731,1734],{},[1057,1732,1733],{},"Scalable"," - Organized namespace hierarchy",[1064,1736,1737,1740],{},[1057,1738,1739],{},"SEO-Friendly"," - Search engine optimized",[1035,1742,1744],{"id":1743},"view-organization","View Organization",[1715,1746,1747,1753,1759,1765],{},[1064,1748,1749,1752],{},[1057,1750,1751],{},"Single Responsibility"," - One purpose per view",[1064,1754,1755,1758],{},[1057,1756,1757],{},"Reusable Components"," - DRY principles",[1064,1760,1761,1764],{},[1057,1762,1763],{},"Error Handling"," - Graceful failure management",[1064,1766,1767,1770],{},[1057,1768,1769],{},"Security First"," - Input validation and protection",[1035,1772,1774],{"id":1773},"performance-considerations","Performance Considerations",[1715,1776,1777,1782,1787,1793],{},[1064,1778,1779,1781],{},[1057,1780,320],{}," - Efficient queries",[1064,1783,1784,1786],{},[1057,1785,793],{}," - Response and data caching",[1064,1788,1789,1792],{},[1057,1790,1791],{},"Resource Management"," - Memory and processing efficiency",[1064,1794,1795,1798],{},[1057,1796,1797],{},"Scalability Planning"," - Load handling and distribution",[1030,1800,1802],{"id":1801},"chapter-structure","Chapter Structure",[1026,1804,1805],{},"This section builds your URL and view expertise systematically:",[1026,1807,1808,1811,1812,1815,1816,1819,1820,1823],{},[1057,1809,1810],{},"Foundation"," - URL dispatcher mechanics and basic view concepts\n",[1057,1813,1814],{},"Implementation"," - Function-based views and request handling\n",[1057,1817,1818],{},"Enhancement"," - Decorators, shortcuts, and advanced techniques\n",[1057,1821,1822],{},"Integration"," - File handling, HTTP methods, and response types",[1026,1825,1826],{},"Each topic includes practical examples, production patterns, and performance considerations that you can implement immediately in your Django projects.",[1026,1828,1829],{},"The URL and view system is where your application logic comes to life. Mastering these concepts ensures you can build maintainable, scalable web applications that handle user requests efficiently and provide excellent user experiences.",[1030,1831,1833],{"id":1832},"common-patterns-preview","Common Patterns Preview",[1035,1835,1837],{"id":1836},"restful-url-design","RESTful URL Design",[1040,1839,1841],{"className":1124,"code":1840,"language":1126,"meta":1049,"style":1049},"# Resource-based URLs\nurlpatterns = [\n    path('posts/', views.post_list, name='post_list'),           # GET: list, POST: create\n    path('posts/\u003Cint:pk>/', views.post_detail, name='post_detail'), # GET: detail, PUT: update, DELETE: delete\n    path('posts/\u003Cint:pk>/edit/', views.post_edit, name='post_edit'), # GET: form, POST: update\n]\n",[1047,1842,1843,1848,1856,1895,1933,1972],{"__ignoreMap":1049},[1130,1844,1845],{"class":1132,"line":1133},[1130,1846,1847],{"class":1136},"# Resource-based URLs\n",[1130,1849,1850,1852,1854],{"class":1132,"line":1140},[1130,1851,1144],{"class":1143},[1130,1853,1148],{"class":1147},[1130,1855,1151],{"class":1147},[1130,1857,1858,1860,1862,1864,1867,1869,1871,1873,1875,1877,1879,1881,1883,1885,1887,1889,1892],{"class":1132,"line":1154},[1130,1859,1158],{"class":1157},[1130,1861,1161],{"class":1147},[1130,1863,1165],{"class":1164},[1130,1865,1866],{"class":1168},"posts/",[1130,1868,1165],{"class":1164},[1130,1870,1174],{"class":1147},[1130,1872,1319],{"class":1157},[1130,1874,1180],{"class":1147},[1130,1876,1324],{"class":1183},[1130,1878,1174],{"class":1147},[1130,1880,1330],{"class":1329},[1130,1882,1148],{"class":1147},[1130,1884,1165],{"class":1164},[1130,1886,1324],{"class":1168},[1130,1888,1165],{"class":1164},[1130,1890,1891],{"class":1147},"),",[1130,1893,1894],{"class":1136},"           # GET: list, POST: create\n",[1130,1896,1897,1899,1901,1903,1906,1908,1910,1912,1914,1916,1918,1920,1922,1924,1926,1928,1930],{"class":1132,"line":1195},[1130,1898,1158],{"class":1157},[1130,1900,1161],{"class":1147},[1130,1902,1165],{"class":1164},[1130,1904,1905],{"class":1168},"posts/\u003Cint:pk>/",[1130,1907,1165],{"class":1164},[1130,1909,1174],{"class":1147},[1130,1911,1319],{"class":1157},[1130,1913,1180],{"class":1147},[1130,1915,1363],{"class":1183},[1130,1917,1174],{"class":1147},[1130,1919,1330],{"class":1329},[1130,1921,1148],{"class":1147},[1130,1923,1165],{"class":1164},[1130,1925,1363],{"class":1168},[1130,1927,1165],{"class":1164},[1130,1929,1891],{"class":1147},[1130,1931,1932],{"class":1136}," # GET: detail, PUT: update, DELETE: delete\n",[1130,1934,1935,1937,1939,1941,1944,1946,1948,1950,1952,1955,1957,1959,1961,1963,1965,1967,1969],{"class":1132,"line":1226},[1130,1936,1158],{"class":1157},[1130,1938,1161],{"class":1147},[1130,1940,1165],{"class":1164},[1130,1942,1943],{"class":1168},"posts/\u003Cint:pk>/edit/",[1130,1945,1165],{"class":1164},[1130,1947,1174],{"class":1147},[1130,1949,1319],{"class":1157},[1130,1951,1180],{"class":1147},[1130,1953,1954],{"class":1183},"post_edit",[1130,1956,1174],{"class":1147},[1130,1958,1330],{"class":1329},[1130,1960,1148],{"class":1147},[1130,1962,1165],{"class":1164},[1130,1964,1954],{"class":1168},[1130,1966,1165],{"class":1164},[1130,1968,1891],{"class":1147},[1130,1970,1971],{"class":1136}," # GET: form, POST: update\n",[1130,1973,1974],{"class":1132,"line":1255},[1130,1975,1283],{"class":1147},[1035,1977,1979],{"id":1978},"view-composition","View Composition",[1040,1981,1983],{"className":1124,"code":1982,"language":1126,"meta":1049,"style":1049},"# Decorator stacking\n@login_required\n@require_http_methods([\"GET\", \"POST\"])\n@cache_page(60 * 15)  # 15 minutes\ndef dashboard(request):\n    # View logic here\n    pass\n",[1047,1984,1985,1990,1999,2030,2056,2074,2079],{"__ignoreMap":1049},[1130,1986,1987],{"class":1132,"line":1133},[1130,1988,1989],{"class":1136},"# Decorator stacking\n",[1130,1991,1992,1995],{"class":1132,"line":1140},[1130,1993,1994],{"class":1147},"@",[1130,1996,1998],{"class":1997},"sljsM","login_required\n",[1130,2000,2001,2003,2006,2009,2012,2015,2017,2019,2022,2025,2027],{"class":1132,"line":1154},[1130,2002,1994],{"class":1147},[1130,2004,2005],{"class":1997},"require_http_methods",[1130,2007,2008],{"class":1147},"([",[1130,2010,2011],{"class":1164},"\"",[1130,2013,2014],{"class":1168},"GET",[1130,2016,2011],{"class":1164},[1130,2018,1174],{"class":1147},[1130,2020,2021],{"class":1164}," \"",[1130,2023,2024],{"class":1168},"POST",[1130,2026,2011],{"class":1164},[1130,2028,2029],{"class":1147},"])\n",[1130,2031,2032,2034,2037,2039,2043,2047,2050,2053],{"class":1132,"line":1195},[1130,2033,1994],{"class":1147},[1130,2035,2036],{"class":1997},"cache_page",[1130,2038,1161],{"class":1147},[1130,2040,2042],{"class":2041},"s7CZa","60",[1130,2044,2046],{"class":2045},"sVsLi"," *",[1130,2048,2049],{"class":2041}," 15",[1130,2051,2052],{"class":1147},")",[1130,2054,2055],{"class":1136},"  # 15 minutes\n",[1130,2057,2058,2062,2065,2067,2071],{"class":1132,"line":1226},[1130,2059,2061],{"class":2060},"s5Kfy","def",[1130,2063,2064],{"class":1997}," dashboard",[1130,2066,1161],{"class":1147},[1130,2068,2070],{"class":2069},"sCyAa","request",[1130,2072,2073],{"class":1147},"):\n",[1130,2075,2076],{"class":1132,"line":1255},[1130,2077,2078],{"class":1136},"    # View logic here\n",[1130,2080,2081],{"class":1132,"line":1280},[1130,2082,2084],{"class":2083},"siDh9","    pass\n",[1035,2086,2088],{"id":2087},"response-patterns","Response Patterns",[1040,2090,2092],{"className":1124,"code":2091,"language":1126,"meta":1049,"style":1049},"# Multiple response types\ndef api_endpoint(request):\n    data = get_data()\n    \n    if request.accepts('application/json'):\n        return JsonResponse(data)\n    else:\n        return render(request, 'template.html', {'data': data})\n",[1047,2093,2094,2099,2112,2125,2130,2154,2170,2178],{"__ignoreMap":1049},[1130,2095,2096],{"class":1132,"line":1133},[1130,2097,2098],{"class":1136},"# Multiple response types\n",[1130,2100,2101,2103,2106,2108,2110],{"class":1132,"line":1140},[1130,2102,2061],{"class":2060},[1130,2104,2105],{"class":1997}," api_endpoint",[1130,2107,1161],{"class":1147},[1130,2109,2070],{"class":2069},[1130,2111,2073],{"class":1147},[1130,2113,2114,2117,2119,2122],{"class":1132,"line":1154},[1130,2115,2116],{"class":1143},"    data ",[1130,2118,1148],{"class":1147},[1130,2120,2121],{"class":1157}," get_data",[1130,2123,2124],{"class":1147},"()\n",[1130,2126,2127],{"class":1132,"line":1195},[1130,2128,2129],{"class":1143},"    \n",[1130,2131,2132,2135,2138,2140,2143,2145,2147,2150,2152],{"class":1132,"line":1226},[1130,2133,2134],{"class":2083},"    if",[1130,2136,2137],{"class":1143}," request",[1130,2139,1180],{"class":1147},[1130,2141,2142],{"class":1157},"accepts",[1130,2144,1161],{"class":1147},[1130,2146,1165],{"class":1164},[1130,2148,2149],{"class":1168},"application/json",[1130,2151,1165],{"class":1164},[1130,2153,2073],{"class":1147},[1130,2155,2156,2159,2162,2164,2167],{"class":1132,"line":1255},[1130,2157,2158],{"class":2083},"        return",[1130,2160,2161],{"class":1157}," JsonResponse",[1130,2163,1161],{"class":1147},[1130,2165,2166],{"class":1157},"data",[1130,2168,2169],{"class":1147},")\n",[1130,2171,2172,2175],{"class":1132,"line":1280},[1130,2173,2174],{"class":2083},"    else",[1130,2176,2177],{"class":1147},":\n",[1130,2179,2180,2182,2185,2187,2189,2191,2194,2197,2199,2201,2204,2206,2208,2210,2213,2216],{"class":1132,"line":1286},[1130,2181,2158],{"class":2083},[1130,2183,2184],{"class":1157}," render",[1130,2186,1161],{"class":1147},[1130,2188,2070],{"class":1157},[1130,2190,1174],{"class":1147},[1130,2192,2193],{"class":1164}," '",[1130,2195,2196],{"class":1168},"template.html",[1130,2198,1165],{"class":1164},[1130,2200,1174],{"class":1147},[1130,2202,2203],{"class":1147}," {",[1130,2205,1165],{"class":1164},[1130,2207,2166],{"class":1168},[1130,2209,1165],{"class":1164},[1130,2211,2212],{"class":1147},":",[1130,2214,2215],{"class":1157}," data",[1130,2217,2218],{"class":1147},"})\n",[1026,2220,2221],{},"Understanding URLs and views is fundamental to Django development. These concepts form the backbone of every Django application, determining how users interact with your system and how your application responds to their requests.",[2223,2224,2225],"style",{},"html pre.shiki code .s9Tkl, html code.shiki .s9Tkl{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#A0ADA0;--shiki-default-font-style:inherit;--shiki-dark:#758575DD;--shiki-dark-font-style:inherit}html pre.shiki code .sftqT, html code.shiki .sftqT{--shiki-light:#90A4AE;--shiki-default:#393A34;--shiki-dark:#DBD7CAEE}html pre.shiki code .soVBu, html code.shiki .soVBu{--shiki-light:#39ADB5;--shiki-default:#999999;--shiki-dark:#666666}html pre.shiki code .siWMO, html code.shiki .siWMO{--shiki-light:#6182B8;--shiki-default:#393A34;--shiki-dark:#DBD7CAEE}html pre.shiki code .sbYkP, html code.shiki .sbYkP{--shiki-light:#39ADB5;--shiki-default:#B5695977;--shiki-dark:#C98A7D77}html pre.shiki code .sTbE_, html code.shiki .sTbE_{--shiki-light:#91B859;--shiki-default:#B56959;--shiki-dark:#C98A7D}html pre.shiki code .sBPpx, html code.shiki .sBPpx{--shiki-light:#E53935;--shiki-default:#393A34;--shiki-dark:#DBD7CAEE}html pre.shiki code .sqOPj, html code.shiki .sqOPj{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#B07D48;--shiki-default-font-style:inherit;--shiki-dark:#BD976A;--shiki-dark-font-style:inherit}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sljsM, html code.shiki .sljsM{--shiki-light:#6182B8;--shiki-default:#59873A;--shiki-dark:#80A665}html pre.shiki code .s7CZa, html code.shiki .s7CZa{--shiki-light:#F76D47;--shiki-default:#2F798A;--shiki-dark:#4C9A91}html pre.shiki code .sVsLi, html code.shiki .sVsLi{--shiki-light:#39ADB5;--shiki-default:#AB5959;--shiki-dark:#CB7676}html pre.shiki code .s5Kfy, html code.shiki .s5Kfy{--shiki-light:#9C3EDA;--shiki-default:#AB5959;--shiki-dark:#CB7676}html pre.shiki code .sCyAa, html code.shiki .sCyAa{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#393A34;--shiki-default-font-style:inherit;--shiki-dark:#DBD7CAEE;--shiki-dark-font-style:inherit}html pre.shiki code .siDh9, html code.shiki .siDh9{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#1E754F;--shiki-default-font-style:inherit;--shiki-dark:#4D9375;--shiki-dark-font-style:inherit}",{"title":1049,"searchDepth":1133,"depth":1140,"links":2227},[2228,2232,2236,2240,2246,2251,2256,2257],{"id":1032,"depth":1140,"text":1033,"children":2229},[2230,2231],{"id":1037,"depth":1154,"text":1038},{"id":1052,"depth":1154,"text":1053},{"id":1116,"depth":1140,"text":1117,"children":2233},[2234,2235],{"id":1120,"depth":1154,"text":1121},{"id":1422,"depth":1154,"text":1423},{"id":1474,"depth":1140,"text":1475,"children":2237},[2238,2239],{"id":1478,"depth":1154,"text":1479},{"id":1520,"depth":1154,"text":1521},{"id":1581,"depth":1140,"text":1582,"children":2241},[2242,2243,2244,2245],{"id":1585,"depth":1154,"text":1586},{"id":1598,"depth":1154,"text":1599},{"id":1615,"depth":1154,"text":1616},{"id":1632,"depth":1154,"text":1633},{"id":1650,"depth":1140,"text":1651,"children":2247},[2248,2249,2250],{"id":1654,"depth":1154,"text":1655},{"id":1672,"depth":1154,"text":1673},{"id":1690,"depth":1154,"text":1691},{"id":1708,"depth":1140,"text":1709,"children":2252},[2253,2254,2255],{"id":1712,"depth":1154,"text":1713},{"id":1743,"depth":1154,"text":1744},{"id":1773,"depth":1154,"text":1774},{"id":1801,"depth":1140,"text":1802},{"id":1832,"depth":1140,"text":1833,"children":2258},[2259,2260,2261],{"id":1836,"depth":1154,"text":1837},{"id":1978,"depth":1154,"text":1979},{"id":2087,"depth":1154,"text":2088},"md",null,{},{"title":124,"description":1028},"CYIJD7ikKmB8l-VXsLDUP8ToxTixw7NNzM1Kxau8_DA",[2268,2270],{"title":120,"path":121,"stem":122,"description":2269,"children":-1},"While Django's built-in template engine is powerful and secure, alternative template engines like Jinja2 offer different features and performance characteristics. This chapter covers integrating alternative engines and choosing the right tool for your needs.",{"title":130,"path":131,"stem":132,"description":2271,"children":-1},"Django's URL dispatcher is a powerful pattern-matching system that maps incoming URLs to view functions. It provides clean, readable URLs while maintaining flexibility for complex routing requirements.",1772474907031]