[{"data":1,"prerenderedAt":4815},["ShallowReactive",2],{"navigation":3,"/introduction-and-foundations/mvc-vs-mvt":1016,"/introduction-and-foundations/mvc-vs-mvt-surround":4810},[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":19,"body":1018,"description":1028,"extension":4805,"links":4806,"meta":4807,"navigation":1130,"path":20,"seo":4808,"stem":21,"__hash__":4809},"docs/01.introduction-and-foundations/04.mvc-vs-mvt.md",{"type":1019,"value":1020,"toc":4765},"minimark",[1021,1025,1029,1034,1037,1042,1048,1064,1069,1083,1088,1102,1106,1383,1387,1390,1394,1398,1412,1417,1434,1439,1453,1457,1460,1480,1484,1569,1573,1577,1804,1808,2423,2427,2431,2439,2443,2449,2453,3099,3103,3107,3110,3136,3140,3143,3287,3291,3294,3390,3394,3397,3661,3665,3669,3683,3687,3704,3708,3712,3718,3722,3727,3731,3736,3740,3744,4092,4096,4568,4572,4758,4761],[1022,1023,19],"h1",{"id":1024},"mvc-vs-mvt-understanding-djangos-architecture",[1026,1027,1028],"p",{},"Django implements the Model-View-Template (MVT) architectural pattern, which is a variation of the traditional Model-View-Controller (MVC) pattern. Understanding the differences and similarities between these patterns is crucial for effective Django development.",[1030,1031,1033],"h2",{"id":1032},"traditional-mvc-pattern","Traditional MVC Pattern",[1026,1035,1036],{},"The Model-View-Controller pattern separates application logic into three interconnected components:",[1038,1039,1041],"h3",{"id":1040},"mvc-components","MVC Components",[1026,1043,1044],{},[1045,1046,1047],"strong",{},"Model (Data Layer)",[1049,1050,1051,1055,1058,1061],"ul",{},[1052,1053,1054],"li",{},"Manages data and business logic",[1052,1056,1057],{},"Handles database operations",[1052,1059,1060],{},"Defines data structure and relationships",[1052,1062,1063],{},"Contains validation rules",[1026,1065,1066],{},[1045,1067,1068],{},"View (Presentation Layer)",[1049,1070,1071,1074,1077,1080],{},[1052,1072,1073],{},"Handles the user interface",[1052,1075,1076],{},"Displays data to the user",[1052,1078,1079],{},"Manages user interaction elements",[1052,1081,1082],{},"Renders the final output",[1026,1084,1085],{},[1045,1086,1087],{},"Controller (Logic Layer)",[1049,1089,1090,1093,1096,1099],{},[1052,1091,1092],{},"Processes user input and requests",[1052,1094,1095],{},"Coordinates between Model and View",[1052,1097,1098],{},"Contains application flow logic",[1052,1100,1101],{},"Handles routing and navigation",[1038,1103,1105],{"id":1104},"mvc-flow-example","MVC Flow Example",[1107,1108,1113],"pre",{"className":1109,"code":1110,"language":1111,"meta":1112,"style":1112},"language-python shiki shiki-themes material-theme-lighter vitesse-light vitesse-dark","# Traditional MVC (conceptual example)\n\n# Controller\nclass ProductController:\n    def list_products(self, request):\n        products = ProductModel.get_all()  # Model interaction\n        return ProductView.render(products)  # View rendering\n\n# Model\nclass ProductModel:\n    @staticmethod\n    def get_all():\n        return database.query(\"SELECT * FROM products\")\n\n# View\nclass ProductView:\n    @staticmethod\n    def render(products):\n        return template.render(\"product_list.html\", {\"products\": products})\n","python","",[1114,1115,1116,1125,1132,1138,1153,1180,1206,1232,1237,1243,1252,1262,1273,1301,1306,1312,1321,1328,1342],"code",{"__ignoreMap":1112},[1117,1118,1121],"span",{"class":1119,"line":1120},"line",1,[1117,1122,1124],{"class":1123},"s9Tkl","# Traditional MVC (conceptual example)\n",[1117,1126,1128],{"class":1119,"line":1127},2,[1117,1129,1131],{"emptyLinePlaceholder":1130},true,"\n",[1117,1133,1135],{"class":1119,"line":1134},3,[1117,1136,1137],{"class":1123},"# Controller\n",[1117,1139,1141,1145,1149],{"class":1119,"line":1140},4,[1117,1142,1144],{"class":1143},"s5Kfy","class",[1117,1146,1148],{"class":1147},"sD-vU"," ProductController",[1117,1150,1152],{"class":1151},"soVBu",":\n",[1117,1154,1156,1159,1163,1166,1170,1173,1177],{"class":1119,"line":1155},5,[1117,1157,1158],{"class":1143},"    def",[1117,1160,1162],{"class":1161},"sljsM"," list_products",[1117,1164,1165],{"class":1151},"(",[1117,1167,1169],{"class":1168},"sRjD_","self",[1117,1171,1172],{"class":1151},",",[1117,1174,1176],{"class":1175},"sCyAa"," request",[1117,1178,1179],{"class":1151},"):\n",[1117,1181,1183,1187,1190,1193,1196,1200,1203],{"class":1119,"line":1182},6,[1117,1184,1186],{"class":1185},"sftqT","        products ",[1117,1188,1189],{"class":1151},"=",[1117,1191,1192],{"class":1185}," ProductModel",[1117,1194,1195],{"class":1151},".",[1117,1197,1199],{"class":1198},"siWMO","get_all",[1117,1201,1202],{"class":1151},"()",[1117,1204,1205],{"class":1123},"  # Model interaction\n",[1117,1207,1209,1213,1216,1218,1221,1223,1226,1229],{"class":1119,"line":1208},7,[1117,1210,1212],{"class":1211},"siDh9","        return",[1117,1214,1215],{"class":1185}," ProductView",[1117,1217,1195],{"class":1151},[1117,1219,1220],{"class":1198},"render",[1117,1222,1165],{"class":1151},[1117,1224,1225],{"class":1198},"products",[1117,1227,1228],{"class":1151},")",[1117,1230,1231],{"class":1123},"  # View rendering\n",[1117,1233,1235],{"class":1119,"line":1234},8,[1117,1236,1131],{"emptyLinePlaceholder":1130},[1117,1238,1240],{"class":1119,"line":1239},9,[1117,1241,1242],{"class":1123},"# Model\n",[1117,1244,1246,1248,1250],{"class":1119,"line":1245},10,[1117,1247,1144],{"class":1143},[1117,1249,1192],{"class":1147},[1117,1251,1152],{"class":1151},[1117,1253,1255,1258],{"class":1119,"line":1254},11,[1117,1256,1257],{"class":1151},"    @",[1117,1259,1261],{"class":1260},"sa2tF","staticmethod\n",[1117,1263,1265,1267,1270],{"class":1119,"line":1264},12,[1117,1266,1158],{"class":1143},[1117,1268,1269],{"class":1161}," get_all",[1117,1271,1272],{"class":1151},"():\n",[1117,1274,1276,1278,1281,1283,1286,1288,1292,1296,1298],{"class":1119,"line":1275},13,[1117,1277,1212],{"class":1211},[1117,1279,1280],{"class":1185}," database",[1117,1282,1195],{"class":1151},[1117,1284,1285],{"class":1198},"query",[1117,1287,1165],{"class":1151},[1117,1289,1291],{"class":1290},"sbYkP","\"",[1117,1293,1295],{"class":1294},"sTbE_","SELECT * FROM products",[1117,1297,1291],{"class":1290},[1117,1299,1300],{"class":1151},")\n",[1117,1302,1304],{"class":1119,"line":1303},14,[1117,1305,1131],{"emptyLinePlaceholder":1130},[1117,1307,1309],{"class":1119,"line":1308},15,[1117,1310,1311],{"class":1123},"# View\n",[1117,1313,1315,1317,1319],{"class":1119,"line":1314},16,[1117,1316,1144],{"class":1143},[1117,1318,1215],{"class":1147},[1117,1320,1152],{"class":1151},[1117,1322,1324,1326],{"class":1119,"line":1323},17,[1117,1325,1257],{"class":1151},[1117,1327,1261],{"class":1260},[1117,1329,1331,1333,1336,1338,1340],{"class":1119,"line":1330},18,[1117,1332,1158],{"class":1143},[1117,1334,1335],{"class":1161}," render",[1117,1337,1165],{"class":1151},[1117,1339,1225],{"class":1175},[1117,1341,1179],{"class":1151},[1117,1343,1345,1347,1350,1352,1354,1356,1358,1361,1363,1365,1368,1370,1372,1374,1377,1380],{"class":1119,"line":1344},19,[1117,1346,1212],{"class":1211},[1117,1348,1349],{"class":1185}," template",[1117,1351,1195],{"class":1151},[1117,1353,1220],{"class":1198},[1117,1355,1165],{"class":1151},[1117,1357,1291],{"class":1290},[1117,1359,1360],{"class":1294},"product_list.html",[1117,1362,1291],{"class":1290},[1117,1364,1172],{"class":1151},[1117,1366,1367],{"class":1151}," {",[1117,1369,1291],{"class":1290},[1117,1371,1225],{"class":1294},[1117,1373,1291],{"class":1290},[1117,1375,1376],{"class":1151},":",[1117,1378,1379],{"class":1198}," products",[1117,1381,1382],{"class":1151},"})\n",[1030,1384,1386],{"id":1385},"djangos-mvt-pattern","Django's MVT Pattern",[1026,1388,1389],{},"Django adapts the MVC pattern into MVT, where the framework itself acts as the controller:",[1038,1391,1393],{"id":1392},"mvt-components","MVT Components",[1026,1395,1396],{},[1045,1397,1047],{},[1049,1399,1400,1403,1406,1409],{},[1052,1401,1402],{},"Same role as MVC Model",[1052,1404,1405],{},"Defines database structure using Django ORM",[1052,1407,1408],{},"Contains business logic and data validation",[1052,1410,1411],{},"Handles database relationships",[1026,1413,1414],{},[1045,1415,1416],{},"View (Logic Layer)",[1049,1418,1419,1422,1425,1428,1431],{},[1052,1420,1421],{},"Functions like MVC Controller",[1052,1423,1424],{},"Processes HTTP requests",[1052,1426,1427],{},"Contains business logic",[1052,1429,1430],{},"Coordinates between Model and Template",[1052,1432,1433],{},"Returns HTTP responses",[1026,1435,1436],{},[1045,1437,1438],{},"Template (Presentation Layer)",[1049,1440,1441,1444,1447,1450],{},[1052,1442,1443],{},"Similar to MVC View",[1052,1445,1446],{},"Handles presentation logic",[1052,1448,1449],{},"Renders HTML with dynamic content",[1052,1451,1452],{},"Manages user interface elements",[1038,1454,1456],{"id":1455},"djangos-hidden-controller","Django's Hidden Controller",[1026,1458,1459],{},"Django's URL dispatcher and framework core act as the controller:",[1049,1461,1462,1468,1474],{},[1052,1463,1464,1467],{},[1045,1465,1466],{},"URL Dispatcher",": Routes requests to appropriate views",[1052,1469,1470,1473],{},[1045,1471,1472],{},"Framework Core",": Handles HTTP protocol, middleware, and request/response cycle",[1052,1475,1476,1479],{},[1045,1477,1478],{},"View Functions/Classes",": Process requests and coordinate responses",[1030,1481,1483],{"id":1482},"side-by-side-comparison","Side-by-Side Comparison",[1485,1486,1487,1506],"table",{},[1488,1489,1490],"thead",{},[1491,1492,1493,1497,1500,1503],"tr",{},[1494,1495,1496],"th",{},"Component",[1494,1498,1499],{},"Traditional MVC",[1494,1501,1502],{},"Django MVT",[1494,1504,1505],{},"Responsibility",[1507,1508,1509,1524,1539,1554],"tbody",{},[1491,1510,1511,1517,1519,1521],{},[1512,1513,1514],"td",{},[1045,1515,1516],{},"Model",[1512,1518,1516],{},[1512,1520,1516],{},[1512,1522,1523],{},"Data management, business logic",[1491,1525,1526,1531,1533,1536],{},[1512,1527,1528],{},[1045,1529,1530],{},"View",[1512,1532,1530],{},[1512,1534,1535],{},"Template",[1512,1537,1538],{},"User interface, presentation",[1491,1540,1541,1546,1548,1551],{},[1512,1542,1543],{},[1045,1544,1545],{},"Controller",[1512,1547,1545],{},[1512,1549,1550],{},"View + Framework",[1512,1552,1553],{},"Request processing, coordination",[1491,1555,1556,1561,1564,1566],{},[1512,1557,1558],{},[1045,1559,1560],{},"Routing",[1512,1562,1563],{},"Part of Controller",[1512,1565,1466],{},[1512,1567,1568],{},"Request routing",[1030,1570,1572],{"id":1571},"practical-implementation-comparison","Practical Implementation Comparison",[1038,1574,1576],{"id":1575},"mvc-example-conceptual","MVC Example (Conceptual)",[1107,1578,1580],{"className":1109,"code":1579,"language":1111,"meta":1112,"style":1112},"# MVC Structure\nclass BlogController:\n    def show_post(self, request, post_id):\n        post = BlogModel.get_post(post_id)\n        if not post:\n            return ErrorView.render_404()\n        return BlogView.render_post(post)\n\nclass BlogModel:\n    @staticmethod\n    def get_post(post_id):\n        return database.get(\"SELECT * FROM posts WHERE id = ?\", post_id)\n\nclass BlogView:\n    @staticmethod\n    def render_post(post):\n        return render_template(\"post.html\", post=post)\n",[1114,1581,1582,1587,1596,1618,1640,1654,1670,1689,1693,1701,1707,1720,1746,1750,1758,1764,1777],{"__ignoreMap":1112},[1117,1583,1584],{"class":1119,"line":1120},[1117,1585,1586],{"class":1123},"# MVC Structure\n",[1117,1588,1589,1591,1594],{"class":1119,"line":1127},[1117,1590,1144],{"class":1143},[1117,1592,1593],{"class":1147}," BlogController",[1117,1595,1152],{"class":1151},[1117,1597,1598,1600,1603,1605,1607,1609,1611,1613,1616],{"class":1119,"line":1134},[1117,1599,1158],{"class":1143},[1117,1601,1602],{"class":1161}," show_post",[1117,1604,1165],{"class":1151},[1117,1606,1169],{"class":1168},[1117,1608,1172],{"class":1151},[1117,1610,1176],{"class":1175},[1117,1612,1172],{"class":1151},[1117,1614,1615],{"class":1175}," post_id",[1117,1617,1179],{"class":1151},[1117,1619,1620,1623,1625,1628,1630,1633,1635,1638],{"class":1119,"line":1140},[1117,1621,1622],{"class":1185},"        post ",[1117,1624,1189],{"class":1151},[1117,1626,1627],{"class":1185}," BlogModel",[1117,1629,1195],{"class":1151},[1117,1631,1632],{"class":1198},"get_post",[1117,1634,1165],{"class":1151},[1117,1636,1637],{"class":1198},"post_id",[1117,1639,1300],{"class":1151},[1117,1641,1642,1645,1649,1652],{"class":1119,"line":1155},[1117,1643,1644],{"class":1211},"        if",[1117,1646,1648],{"class":1647},"sVsLi"," not",[1117,1650,1651],{"class":1185}," post",[1117,1653,1152],{"class":1151},[1117,1655,1656,1659,1662,1664,1667],{"class":1119,"line":1182},[1117,1657,1658],{"class":1211},"            return",[1117,1660,1661],{"class":1185}," ErrorView",[1117,1663,1195],{"class":1151},[1117,1665,1666],{"class":1198},"render_404",[1117,1668,1669],{"class":1151},"()\n",[1117,1671,1672,1674,1677,1679,1682,1684,1687],{"class":1119,"line":1208},[1117,1673,1212],{"class":1211},[1117,1675,1676],{"class":1185}," BlogView",[1117,1678,1195],{"class":1151},[1117,1680,1681],{"class":1198},"render_post",[1117,1683,1165],{"class":1151},[1117,1685,1686],{"class":1198},"post",[1117,1688,1300],{"class":1151},[1117,1690,1691],{"class":1119,"line":1234},[1117,1692,1131],{"emptyLinePlaceholder":1130},[1117,1694,1695,1697,1699],{"class":1119,"line":1239},[1117,1696,1144],{"class":1143},[1117,1698,1627],{"class":1147},[1117,1700,1152],{"class":1151},[1117,1702,1703,1705],{"class":1119,"line":1245},[1117,1704,1257],{"class":1151},[1117,1706,1261],{"class":1260},[1117,1708,1709,1711,1714,1716,1718],{"class":1119,"line":1254},[1117,1710,1158],{"class":1143},[1117,1712,1713],{"class":1161}," get_post",[1117,1715,1165],{"class":1151},[1117,1717,1637],{"class":1175},[1117,1719,1179],{"class":1151},[1117,1721,1722,1724,1726,1728,1731,1733,1735,1738,1740,1742,1744],{"class":1119,"line":1264},[1117,1723,1212],{"class":1211},[1117,1725,1280],{"class":1185},[1117,1727,1195],{"class":1151},[1117,1729,1730],{"class":1198},"get",[1117,1732,1165],{"class":1151},[1117,1734,1291],{"class":1290},[1117,1736,1737],{"class":1294},"SELECT * FROM posts WHERE id = ?",[1117,1739,1291],{"class":1290},[1117,1741,1172],{"class":1151},[1117,1743,1615],{"class":1198},[1117,1745,1300],{"class":1151},[1117,1747,1748],{"class":1119,"line":1275},[1117,1749,1131],{"emptyLinePlaceholder":1130},[1117,1751,1752,1754,1756],{"class":1119,"line":1303},[1117,1753,1144],{"class":1143},[1117,1755,1676],{"class":1147},[1117,1757,1152],{"class":1151},[1117,1759,1760,1762],{"class":1119,"line":1308},[1117,1761,1257],{"class":1151},[1117,1763,1261],{"class":1260},[1117,1765,1766,1768,1771,1773,1775],{"class":1119,"line":1314},[1117,1767,1158],{"class":1143},[1117,1769,1770],{"class":1161}," render_post",[1117,1772,1165],{"class":1151},[1117,1774,1686],{"class":1175},[1117,1776,1179],{"class":1151},[1117,1778,1779,1781,1784,1786,1788,1791,1793,1795,1798,1800,1802],{"class":1119,"line":1323},[1117,1780,1212],{"class":1211},[1117,1782,1783],{"class":1198}," render_template",[1117,1785,1165],{"class":1151},[1117,1787,1291],{"class":1290},[1117,1789,1790],{"class":1294},"post.html",[1117,1792,1291],{"class":1290},[1117,1794,1172],{"class":1151},[1117,1796,1651],{"class":1797},"sqOPj",[1117,1799,1189],{"class":1151},[1117,1801,1686],{"class":1198},[1117,1803,1300],{"class":1151},[1038,1805,1807],{"id":1806},"django-mvt-implementation","Django MVT Implementation",[1107,1809,1811],{"className":1109,"code":1810,"language":1111,"meta":1112,"style":1112},"# Django MVT Structure\n\n# Model (models.py)\nclass BlogPost(models.Model):\n    title = models.CharField(max_length=200)\n    content = models.TextField()\n    author = models.ForeignKey(User, on_delete=models.CASCADE)\n    created_at = models.DateTimeField(auto_now_add=True)\n    \n    def __str__(self):\n        return self.title\n    \n    def get_absolute_url(self):\n        return reverse('blog:post_detail', kwargs={'pk': self.pk})\n\n# View (views.py) - Acts like MVC Controller\ndef post_detail(request, post_id):\n    post = get_object_or_404(BlogPost, pk=post_id)  # Model interaction\n    context = {'post': post}\n    return render(request, 'blog/post_detail.html', context)  # Template rendering\n\n# Alternative class-based view\nclass PostDetailView(DetailView):\n    model = BlogPost\n    template_name = 'blog/post_detail.html'\n    context_object_name = 'post'\n\n# URL Configuration (urls.py) - Framework Controller\nurlpatterns = [\n    path('post/\u003Cint:post_id>/', views.post_detail, name='post_detail'),\n    path('post/\u003Cint:pk>/', views.PostDetailView.as_view(), name='post_detail_cbv'),\n]\n\n# Template (post_detail.html) - Acts like MVC View\n\"\"\"\n{% extends 'base.html' %}\n\n{% block content %}\n    \u003Carticle>\n        \u003Ch1>{{ post.title }}\u003C/h1>\n        \u003Cp class=\"meta\">By {{ post.author }} on {{ post.created_at|date:\"F d, Y\" }}\u003C/p>\n        \u003Cdiv class=\"content\">\n            {{ post.content|linebreaks }}\n        \u003C/div>\n    \u003C/article>\n{% endblock %}\n\"\"\"\n",[1114,1812,1813,1818,1822,1827,1846,1874,1890,1926,1953,1958,1972,1986,1990,2003,2045,2049,2054,2073,2101,2123,2155,2160,2166,2181,2192,2207,2221,2226,2232,2243,2284,2328,2334,2339,2345,2352,2359,2364,2370,2376,2382,2388,2394,2400,2406,2412,2418],{"__ignoreMap":1112},[1117,1814,1815],{"class":1119,"line":1120},[1117,1816,1817],{"class":1123},"# Django MVT Structure\n",[1117,1819,1820],{"class":1119,"line":1127},[1117,1821,1131],{"emptyLinePlaceholder":1130},[1117,1823,1824],{"class":1119,"line":1134},[1117,1825,1826],{"class":1123},"# Model (models.py)\n",[1117,1828,1829,1831,1834,1836,1840,1842,1844],{"class":1119,"line":1140},[1117,1830,1144],{"class":1143},[1117,1832,1833],{"class":1147}," BlogPost",[1117,1835,1165],{"class":1151},[1117,1837,1839],{"class":1838},"sYn-s","models",[1117,1841,1195],{"class":1151},[1117,1843,1516],{"class":1838},[1117,1845,1179],{"class":1151},[1117,1847,1848,1851,1853,1856,1858,1861,1863,1866,1868,1872],{"class":1119,"line":1155},[1117,1849,1850],{"class":1185},"    title ",[1117,1852,1189],{"class":1151},[1117,1854,1855],{"class":1185}," models",[1117,1857,1195],{"class":1151},[1117,1859,1860],{"class":1198},"CharField",[1117,1862,1165],{"class":1151},[1117,1864,1865],{"class":1797},"max_length",[1117,1867,1189],{"class":1151},[1117,1869,1871],{"class":1870},"s7CZa","200",[1117,1873,1300],{"class":1151},[1117,1875,1876,1879,1881,1883,1885,1888],{"class":1119,"line":1182},[1117,1877,1878],{"class":1185},"    content ",[1117,1880,1189],{"class":1151},[1117,1882,1855],{"class":1185},[1117,1884,1195],{"class":1151},[1117,1886,1887],{"class":1198},"TextField",[1117,1889,1669],{"class":1151},[1117,1891,1892,1895,1897,1899,1901,1904,1906,1909,1911,1914,1916,1918,1920,1924],{"class":1119,"line":1208},[1117,1893,1894],{"class":1185},"    author ",[1117,1896,1189],{"class":1151},[1117,1898,1855],{"class":1185},[1117,1900,1195],{"class":1151},[1117,1902,1903],{"class":1198},"ForeignKey",[1117,1905,1165],{"class":1151},[1117,1907,1908],{"class":1198},"User",[1117,1910,1172],{"class":1151},[1117,1912,1913],{"class":1797}," on_delete",[1117,1915,1189],{"class":1151},[1117,1917,1839],{"class":1198},[1117,1919,1195],{"class":1151},[1117,1921,1923],{"class":1922},"sFGJz","CASCADE",[1117,1925,1300],{"class":1151},[1117,1927,1928,1931,1933,1935,1937,1940,1942,1945,1947,1951],{"class":1119,"line":1234},[1117,1929,1930],{"class":1185},"    created_at ",[1117,1932,1189],{"class":1151},[1117,1934,1855],{"class":1185},[1117,1936,1195],{"class":1151},[1117,1938,1939],{"class":1198},"DateTimeField",[1117,1941,1165],{"class":1151},[1117,1943,1944],{"class":1797},"auto_now_add",[1117,1946,1189],{"class":1151},[1117,1948,1950],{"class":1949},"s8XtY","True",[1117,1952,1300],{"class":1151},[1117,1954,1955],{"class":1119,"line":1239},[1117,1956,1957],{"class":1185},"    \n",[1117,1959,1960,1962,1966,1968,1970],{"class":1119,"line":1245},[1117,1961,1158],{"class":1143},[1117,1963,1965],{"class":1964},"sJdAF"," __str__",[1117,1967,1165],{"class":1151},[1117,1969,1169],{"class":1168},[1117,1971,1179],{"class":1151},[1117,1973,1974,1976,1980,1982],{"class":1119,"line":1254},[1117,1975,1212],{"class":1211},[1117,1977,1979],{"class":1978},"se3Ec"," self",[1117,1981,1195],{"class":1151},[1117,1983,1985],{"class":1984},"sBPpx","title\n",[1117,1987,1988],{"class":1119,"line":1264},[1117,1989,1957],{"class":1185},[1117,1991,1992,1994,1997,1999,2001],{"class":1119,"line":1275},[1117,1993,1158],{"class":1143},[1117,1995,1996],{"class":1161}," get_absolute_url",[1117,1998,1165],{"class":1151},[1117,2000,1169],{"class":1168},[1117,2002,1179],{"class":1151},[1117,2004,2005,2007,2010,2012,2015,2018,2020,2022,2025,2028,2030,2033,2035,2037,2039,2041,2043],{"class":1119,"line":1303},[1117,2006,1212],{"class":1211},[1117,2008,2009],{"class":1198}," reverse",[1117,2011,1165],{"class":1151},[1117,2013,2014],{"class":1290},"'",[1117,2016,2017],{"class":1294},"blog:post_detail",[1117,2019,2014],{"class":1290},[1117,2021,1172],{"class":1151},[1117,2023,2024],{"class":1797}," kwargs",[1117,2026,2027],{"class":1151},"={",[1117,2029,2014],{"class":1290},[1117,2031,2032],{"class":1294},"pk",[1117,2034,2014],{"class":1290},[1117,2036,1376],{"class":1151},[1117,2038,1979],{"class":1978},[1117,2040,1195],{"class":1151},[1117,2042,2032],{"class":1984},[1117,2044,1382],{"class":1151},[1117,2046,2047],{"class":1119,"line":1308},[1117,2048,1131],{"emptyLinePlaceholder":1130},[1117,2050,2051],{"class":1119,"line":1314},[1117,2052,2053],{"class":1123},"# View (views.py) - Acts like MVC Controller\n",[1117,2055,2056,2059,2062,2064,2067,2069,2071],{"class":1119,"line":1323},[1117,2057,2058],{"class":1143},"def",[1117,2060,2061],{"class":1161}," post_detail",[1117,2063,1165],{"class":1151},[1117,2065,2066],{"class":1175},"request",[1117,2068,1172],{"class":1151},[1117,2070,1615],{"class":1175},[1117,2072,1179],{"class":1151},[1117,2074,2075,2078,2080,2083,2085,2088,2090,2093,2095,2097,2099],{"class":1119,"line":1330},[1117,2076,2077],{"class":1185},"    post ",[1117,2079,1189],{"class":1151},[1117,2081,2082],{"class":1198}," get_object_or_404",[1117,2084,1165],{"class":1151},[1117,2086,2087],{"class":1198},"BlogPost",[1117,2089,1172],{"class":1151},[1117,2091,2092],{"class":1797}," pk",[1117,2094,1189],{"class":1151},[1117,2096,1637],{"class":1198},[1117,2098,1228],{"class":1151},[1117,2100,1205],{"class":1123},[1117,2102,2103,2106,2108,2110,2112,2114,2116,2118,2120],{"class":1119,"line":1344},[1117,2104,2105],{"class":1185},"    context ",[1117,2107,1189],{"class":1151},[1117,2109,1367],{"class":1151},[1117,2111,2014],{"class":1290},[1117,2113,1686],{"class":1294},[1117,2115,2014],{"class":1290},[1117,2117,1376],{"class":1151},[1117,2119,1651],{"class":1185},[1117,2121,2122],{"class":1151},"}\n",[1117,2124,2126,2129,2131,2133,2135,2137,2140,2143,2145,2147,2150,2152],{"class":1119,"line":2125},20,[1117,2127,2128],{"class":1211},"    return",[1117,2130,1335],{"class":1198},[1117,2132,1165],{"class":1151},[1117,2134,2066],{"class":1198},[1117,2136,1172],{"class":1151},[1117,2138,2139],{"class":1290}," '",[1117,2141,2142],{"class":1294},"blog/post_detail.html",[1117,2144,2014],{"class":1290},[1117,2146,1172],{"class":1151},[1117,2148,2149],{"class":1198}," context",[1117,2151,1228],{"class":1151},[1117,2153,2154],{"class":1123},"  # Template rendering\n",[1117,2156,2158],{"class":1119,"line":2157},21,[1117,2159,1131],{"emptyLinePlaceholder":1130},[1117,2161,2163],{"class":1119,"line":2162},22,[1117,2164,2165],{"class":1123},"# Alternative class-based view\n",[1117,2167,2169,2171,2174,2176,2179],{"class":1119,"line":2168},23,[1117,2170,1144],{"class":1143},[1117,2172,2173],{"class":1147}," PostDetailView",[1117,2175,1165],{"class":1151},[1117,2177,2178],{"class":1838},"DetailView",[1117,2180,1179],{"class":1151},[1117,2182,2184,2187,2189],{"class":1119,"line":2183},24,[1117,2185,2186],{"class":1185},"    model ",[1117,2188,1189],{"class":1151},[1117,2190,2191],{"class":1185}," BlogPost\n",[1117,2193,2195,2198,2200,2202,2204],{"class":1119,"line":2194},25,[1117,2196,2197],{"class":1185},"    template_name ",[1117,2199,1189],{"class":1151},[1117,2201,2139],{"class":1290},[1117,2203,2142],{"class":1294},[1117,2205,2206],{"class":1290},"'\n",[1117,2208,2210,2213,2215,2217,2219],{"class":1119,"line":2209},26,[1117,2211,2212],{"class":1185},"    context_object_name ",[1117,2214,1189],{"class":1151},[1117,2216,2139],{"class":1290},[1117,2218,1686],{"class":1294},[1117,2220,2206],{"class":1290},[1117,2222,2224],{"class":1119,"line":2223},27,[1117,2225,1131],{"emptyLinePlaceholder":1130},[1117,2227,2229],{"class":1119,"line":2228},28,[1117,2230,2231],{"class":1123},"# URL Configuration (urls.py) - Framework Controller\n",[1117,2233,2235,2238,2240],{"class":1119,"line":2234},29,[1117,2236,2237],{"class":1185},"urlpatterns ",[1117,2239,1189],{"class":1151},[1117,2241,2242],{"class":1151}," [\n",[1117,2244,2246,2249,2251,2253,2256,2258,2260,2263,2265,2268,2270,2273,2275,2277,2279,2281],{"class":1119,"line":2245},30,[1117,2247,2248],{"class":1198},"    path",[1117,2250,1165],{"class":1151},[1117,2252,2014],{"class":1290},[1117,2254,2255],{"class":1294},"post/\u003Cint:post_id>/",[1117,2257,2014],{"class":1290},[1117,2259,1172],{"class":1151},[1117,2261,2262],{"class":1198}," views",[1117,2264,1195],{"class":1151},[1117,2266,2267],{"class":1984},"post_detail",[1117,2269,1172],{"class":1151},[1117,2271,2272],{"class":1797}," name",[1117,2274,1189],{"class":1151},[1117,2276,2014],{"class":1290},[1117,2278,2267],{"class":1294},[1117,2280,2014],{"class":1290},[1117,2282,2283],{"class":1151},"),\n",[1117,2285,2287,2289,2291,2293,2296,2298,2300,2302,2304,2307,2309,2312,2315,2317,2319,2321,2324,2326],{"class":1119,"line":2286},31,[1117,2288,2248],{"class":1198},[1117,2290,1165],{"class":1151},[1117,2292,2014],{"class":1290},[1117,2294,2295],{"class":1294},"post/\u003Cint:pk>/",[1117,2297,2014],{"class":1290},[1117,2299,1172],{"class":1151},[1117,2301,2262],{"class":1198},[1117,2303,1195],{"class":1151},[1117,2305,2306],{"class":1984},"PostDetailView",[1117,2308,1195],{"class":1151},[1117,2310,2311],{"class":1198},"as_view",[1117,2313,2314],{"class":1151},"(),",[1117,2316,2272],{"class":1797},[1117,2318,1189],{"class":1151},[1117,2320,2014],{"class":1290},[1117,2322,2323],{"class":1294},"post_detail_cbv",[1117,2325,2014],{"class":1290},[1117,2327,2283],{"class":1151},[1117,2329,2331],{"class":1119,"line":2330},32,[1117,2332,2333],{"class":1151},"]\n",[1117,2335,2337],{"class":1119,"line":2336},33,[1117,2338,1131],{"emptyLinePlaceholder":1130},[1117,2340,2342],{"class":1119,"line":2341},34,[1117,2343,2344],{"class":1123},"# Template (post_detail.html) - Acts like MVC View\n",[1117,2346,2348],{"class":1119,"line":2347},35,[1117,2349,2351],{"class":2350},"sm7ve","\"\"\"\n",[1117,2353,2355],{"class":1119,"line":2354},36,[1117,2356,2358],{"class":2357},"sVyVU","{% extends 'base.html' %}\n",[1117,2360,2362],{"class":1119,"line":2361},37,[1117,2363,1131],{"emptyLinePlaceholder":1130},[1117,2365,2367],{"class":1119,"line":2366},38,[1117,2368,2369],{"class":2357},"{% block content %}\n",[1117,2371,2373],{"class":1119,"line":2372},39,[1117,2374,2375],{"class":2357},"    \u003Carticle>\n",[1117,2377,2379],{"class":1119,"line":2378},40,[1117,2380,2381],{"class":2357},"        \u003Ch1>{{ post.title }}\u003C/h1>\n",[1117,2383,2385],{"class":1119,"line":2384},41,[1117,2386,2387],{"class":2357},"        \u003Cp class=\"meta\">By {{ post.author }} on {{ post.created_at|date:\"F d, Y\" }}\u003C/p>\n",[1117,2389,2391],{"class":1119,"line":2390},42,[1117,2392,2393],{"class":2357},"        \u003Cdiv class=\"content\">\n",[1117,2395,2397],{"class":1119,"line":2396},43,[1117,2398,2399],{"class":2357},"            {{ post.content|linebreaks }}\n",[1117,2401,2403],{"class":1119,"line":2402},44,[1117,2404,2405],{"class":2357},"        \u003C/div>\n",[1117,2407,2409],{"class":1119,"line":2408},45,[1117,2410,2411],{"class":2357},"    \u003C/article>\n",[1117,2413,2415],{"class":1119,"line":2414},46,[1117,2416,2417],{"class":2357},"{% endblock %}\n",[1117,2419,2421],{"class":1119,"line":2420},47,[1117,2422,2351],{"class":2350},[1030,2424,2426],{"id":2425},"request-flow-comparison","Request Flow Comparison",[1038,2428,2430],{"id":2429},"traditional-mvc-flow","Traditional MVC Flow",[1107,2432,2437],{"className":2433,"code":2435,"language":2436},[2434],"language-text","1. User Request → Router\n2. Router → Controller\n3. Controller → Model (data retrieval)\n4. Model → Controller (data returned)\n5. Controller → View (data passed)\n6. View → User (rendered response)\n","text",[1114,2438,2435],{"__ignoreMap":1112},[1038,2440,2442],{"id":2441},"django-mvt-flow","Django MVT Flow",[1107,2444,2447],{"className":2445,"code":2446,"language":2436},[2434],"1. User Request → URL Dispatcher\n2. URL Dispatcher → View (Django's \"Controller\")\n3. View → Model (data retrieval)\n4. Model → View (data returned)\n5. View → Template (context passed)\n6. Template → User (rendered HTML response)\n",[1114,2448,2446],{"__ignoreMap":1112},[1030,2450,2452],{"id":2451},"detailed-django-request-cycle","Detailed Django Request Cycle",[1107,2454,2456],{"className":1109,"code":2455,"language":1111,"meta":1112,"style":1112},"# 1. URL Resolution\n# urls.py\nurlpatterns = [\n    path('products/\u003Cint:pk>/', views.ProductDetailView.as_view(), name='product_detail'),\n]\n\n# 2. Middleware Processing (Framework Controller)\nclass SecurityMiddleware:\n    def __init__(self, get_response):\n        self.get_response = get_response\n    \n    def __call__(self, request):\n        # Process request\n        response = self.get_response(request)\n        # Process response\n        return response\n\n# 3. View Processing (MVT View = MVC Controller)\nclass ProductDetailView(DetailView):\n    model = Product  # Model interaction\n    template_name = 'products/detail.html'  # Template specification\n    \n    def get_context_data(self, **kwargs):\n        context = super().get_context_data(**kwargs)\n        context['related_products'] = Product.objects.filter(\n            category=self.object.category\n        ).exclude(pk=self.object.pk)[:3]\n        return context\n\n# 4. Model Layer (Same as MVC Model)\nclass Product(models.Model):\n    name = models.CharField(max_length=200)\n    price = models.DecimalField(max_digits=10, decimal_places=2)\n    category = models.ForeignKey(Category, on_delete=models.CASCADE)\n    \n    def get_discounted_price(self, discount_percent):\n        return self.price * (1 - discount_percent / 100)\n\n# 5. Template Rendering (MVT Template = MVC View)\n# products/detail.html\n\"\"\"\n{% extends 'base.html' %}\n\n{% block content %}\n    \u003Cdiv class=\"product-detail\">\n        \u003Ch1>{{ product.name }}\u003C/h1>\n        \u003Cp class=\"price\">${{ product.price }}\u003C/p>\n        \n        \u003Ch3>Related Products\u003C/h3>\n        {% for related in related_products %}\n            \u003Cdiv class=\"related-product\">\n                \u003Ca href=\"{{ related.get_absolute_url }}\">{{ related.name }}\u003C/a>\n            \u003C/div>\n        {% endfor %}\n    \u003C/div>\n{% endblock %}\n\"\"\"\n",[1114,2457,2458,2463,2468,2476,2517,2521,2525,2530,2539,2557,2573,2577,2594,2599,2618,2623,2630,2634,2639,2652,2664,2680,2684,2705,2730,2766,2785,2817,2824,2828,2833,2849,2872,2908,2940,2944,2962,2996,3000,3005,3010,3014,3018,3022,3026,3031,3036,3041,3047,3053,3059,3065,3071,3077,3083,3089,3094],{"__ignoreMap":1112},[1117,2459,2460],{"class":1119,"line":1120},[1117,2461,2462],{"class":1123},"# 1. URL Resolution\n",[1117,2464,2465],{"class":1119,"line":1127},[1117,2466,2467],{"class":1123},"# urls.py\n",[1117,2469,2470,2472,2474],{"class":1119,"line":1134},[1117,2471,2237],{"class":1185},[1117,2473,1189],{"class":1151},[1117,2475,2242],{"class":1151},[1117,2477,2478,2480,2482,2484,2487,2489,2491,2493,2495,2498,2500,2502,2504,2506,2508,2510,2513,2515],{"class":1119,"line":1140},[1117,2479,2248],{"class":1198},[1117,2481,1165],{"class":1151},[1117,2483,2014],{"class":1290},[1117,2485,2486],{"class":1294},"products/\u003Cint:pk>/",[1117,2488,2014],{"class":1290},[1117,2490,1172],{"class":1151},[1117,2492,2262],{"class":1198},[1117,2494,1195],{"class":1151},[1117,2496,2497],{"class":1984},"ProductDetailView",[1117,2499,1195],{"class":1151},[1117,2501,2311],{"class":1198},[1117,2503,2314],{"class":1151},[1117,2505,2272],{"class":1797},[1117,2507,1189],{"class":1151},[1117,2509,2014],{"class":1290},[1117,2511,2512],{"class":1294},"product_detail",[1117,2514,2014],{"class":1290},[1117,2516,2283],{"class":1151},[1117,2518,2519],{"class":1119,"line":1155},[1117,2520,2333],{"class":1151},[1117,2522,2523],{"class":1119,"line":1182},[1117,2524,1131],{"emptyLinePlaceholder":1130},[1117,2526,2527],{"class":1119,"line":1208},[1117,2528,2529],{"class":1123},"# 2. Middleware Processing (Framework Controller)\n",[1117,2531,2532,2534,2537],{"class":1119,"line":1234},[1117,2533,1144],{"class":1143},[1117,2535,2536],{"class":1147}," SecurityMiddleware",[1117,2538,1152],{"class":1151},[1117,2540,2541,2543,2546,2548,2550,2552,2555],{"class":1119,"line":1239},[1117,2542,1158],{"class":1143},[1117,2544,2545],{"class":1964}," __init__",[1117,2547,1165],{"class":1151},[1117,2549,1169],{"class":1168},[1117,2551,1172],{"class":1151},[1117,2553,2554],{"class":1175}," get_response",[1117,2556,1179],{"class":1151},[1117,2558,2559,2562,2564,2567,2570],{"class":1119,"line":1245},[1117,2560,2561],{"class":1978},"        self",[1117,2563,1195],{"class":1151},[1117,2565,2566],{"class":1984},"get_response",[1117,2568,2569],{"class":1151}," =",[1117,2571,2572],{"class":1185}," get_response\n",[1117,2574,2575],{"class":1119,"line":1254},[1117,2576,1957],{"class":1185},[1117,2578,2579,2581,2584,2586,2588,2590,2592],{"class":1119,"line":1264},[1117,2580,1158],{"class":1143},[1117,2582,2583],{"class":1964}," __call__",[1117,2585,1165],{"class":1151},[1117,2587,1169],{"class":1168},[1117,2589,1172],{"class":1151},[1117,2591,1176],{"class":1175},[1117,2593,1179],{"class":1151},[1117,2595,2596],{"class":1119,"line":1275},[1117,2597,2598],{"class":1123},"        # Process request\n",[1117,2600,2601,2604,2606,2608,2610,2612,2614,2616],{"class":1119,"line":1303},[1117,2602,2603],{"class":1185},"        response ",[1117,2605,1189],{"class":1151},[1117,2607,1979],{"class":1978},[1117,2609,1195],{"class":1151},[1117,2611,2566],{"class":1198},[1117,2613,1165],{"class":1151},[1117,2615,2066],{"class":1198},[1117,2617,1300],{"class":1151},[1117,2619,2620],{"class":1119,"line":1308},[1117,2621,2622],{"class":1123},"        # Process response\n",[1117,2624,2625,2627],{"class":1119,"line":1314},[1117,2626,1212],{"class":1211},[1117,2628,2629],{"class":1185}," response\n",[1117,2631,2632],{"class":1119,"line":1323},[1117,2633,1131],{"emptyLinePlaceholder":1130},[1117,2635,2636],{"class":1119,"line":1330},[1117,2637,2638],{"class":1123},"# 3. View Processing (MVT View = MVC Controller)\n",[1117,2640,2641,2643,2646,2648,2650],{"class":1119,"line":1344},[1117,2642,1144],{"class":1143},[1117,2644,2645],{"class":1147}," ProductDetailView",[1117,2647,1165],{"class":1151},[1117,2649,2178],{"class":1838},[1117,2651,1179],{"class":1151},[1117,2653,2654,2656,2658,2661],{"class":1119,"line":2125},[1117,2655,2186],{"class":1185},[1117,2657,1189],{"class":1151},[1117,2659,2660],{"class":1185}," Product  ",[1117,2662,2663],{"class":1123},"# Model interaction\n",[1117,2665,2666,2668,2670,2672,2675,2677],{"class":1119,"line":2157},[1117,2667,2197],{"class":1185},[1117,2669,1189],{"class":1151},[1117,2671,2139],{"class":1290},[1117,2673,2674],{"class":1294},"products/detail.html",[1117,2676,2014],{"class":1290},[1117,2678,2679],{"class":1123},"  # Template specification\n",[1117,2681,2682],{"class":1119,"line":2162},[1117,2683,1957],{"class":1185},[1117,2685,2686,2688,2691,2693,2695,2697,2700,2703],{"class":1119,"line":2168},[1117,2687,1158],{"class":1143},[1117,2689,2690],{"class":1161}," get_context_data",[1117,2692,1165],{"class":1151},[1117,2694,1169],{"class":1168},[1117,2696,1172],{"class":1151},[1117,2698,2699],{"class":1647}," **",[1117,2701,2702],{"class":1175},"kwargs",[1117,2704,1179],{"class":1151},[1117,2706,2707,2710,2712,2715,2718,2721,2723,2726,2728],{"class":1119,"line":2183},[1117,2708,2709],{"class":1185},"        context ",[1117,2711,1189],{"class":1151},[1117,2713,2714],{"class":1260}," super",[1117,2716,2717],{"class":1151},"().",[1117,2719,2720],{"class":1198},"get_context_data",[1117,2722,1165],{"class":1151},[1117,2724,2725],{"class":1647},"**",[1117,2727,2702],{"class":1198},[1117,2729,1300],{"class":1151},[1117,2731,2732,2735,2738,2740,2743,2745,2748,2750,2753,2755,2758,2760,2763],{"class":1119,"line":2194},[1117,2733,2734],{"class":1185},"        context",[1117,2736,2737],{"class":1151},"[",[1117,2739,2014],{"class":1290},[1117,2741,2742],{"class":1294},"related_products",[1117,2744,2014],{"class":1290},[1117,2746,2747],{"class":1151},"]",[1117,2749,2569],{"class":1151},[1117,2751,2752],{"class":1185}," Product",[1117,2754,1195],{"class":1151},[1117,2756,2757],{"class":1984},"objects",[1117,2759,1195],{"class":1151},[1117,2761,2762],{"class":1198},"filter",[1117,2764,2765],{"class":1151},"(\n",[1117,2767,2768,2771,2773,2775,2777,2780,2782],{"class":1119,"line":2209},[1117,2769,2770],{"class":1797},"            category",[1117,2772,1189],{"class":1151},[1117,2774,1169],{"class":1978},[1117,2776,1195],{"class":1151},[1117,2778,2779],{"class":1984},"object",[1117,2781,1195],{"class":1151},[1117,2783,2784],{"class":1984},"category\n",[1117,2786,2787,2790,2793,2795,2797,2799,2801,2803,2805,2807,2809,2812,2815],{"class":1119,"line":2223},[1117,2788,2789],{"class":1151},"        ).",[1117,2791,2792],{"class":1198},"exclude",[1117,2794,1165],{"class":1151},[1117,2796,2032],{"class":1797},[1117,2798,1189],{"class":1151},[1117,2800,1169],{"class":1978},[1117,2802,1195],{"class":1151},[1117,2804,2779],{"class":1984},[1117,2806,1195],{"class":1151},[1117,2808,2032],{"class":1984},[1117,2810,2811],{"class":1151},")[:",[1117,2813,2814],{"class":1870},"3",[1117,2816,2333],{"class":1151},[1117,2818,2819,2821],{"class":1119,"line":2228},[1117,2820,1212],{"class":1211},[1117,2822,2823],{"class":1185}," context\n",[1117,2825,2826],{"class":1119,"line":2234},[1117,2827,1131],{"emptyLinePlaceholder":1130},[1117,2829,2830],{"class":1119,"line":2245},[1117,2831,2832],{"class":1123},"# 4. Model Layer (Same as MVC Model)\n",[1117,2834,2835,2837,2839,2841,2843,2845,2847],{"class":1119,"line":2286},[1117,2836,1144],{"class":1143},[1117,2838,2752],{"class":1147},[1117,2840,1165],{"class":1151},[1117,2842,1839],{"class":1838},[1117,2844,1195],{"class":1151},[1117,2846,1516],{"class":1838},[1117,2848,1179],{"class":1151},[1117,2850,2851,2854,2856,2858,2860,2862,2864,2866,2868,2870],{"class":1119,"line":2330},[1117,2852,2853],{"class":1185},"    name ",[1117,2855,1189],{"class":1151},[1117,2857,1855],{"class":1185},[1117,2859,1195],{"class":1151},[1117,2861,1860],{"class":1198},[1117,2863,1165],{"class":1151},[1117,2865,1865],{"class":1797},[1117,2867,1189],{"class":1151},[1117,2869,1871],{"class":1870},[1117,2871,1300],{"class":1151},[1117,2873,2874,2877,2879,2881,2883,2886,2888,2891,2893,2896,2898,2901,2903,2906],{"class":1119,"line":2336},[1117,2875,2876],{"class":1185},"    price ",[1117,2878,1189],{"class":1151},[1117,2880,1855],{"class":1185},[1117,2882,1195],{"class":1151},[1117,2884,2885],{"class":1198},"DecimalField",[1117,2887,1165],{"class":1151},[1117,2889,2890],{"class":1797},"max_digits",[1117,2892,1189],{"class":1151},[1117,2894,2895],{"class":1870},"10",[1117,2897,1172],{"class":1151},[1117,2899,2900],{"class":1797}," decimal_places",[1117,2902,1189],{"class":1151},[1117,2904,2905],{"class":1870},"2",[1117,2907,1300],{"class":1151},[1117,2909,2910,2913,2915,2917,2919,2921,2923,2926,2928,2930,2932,2934,2936,2938],{"class":1119,"line":2341},[1117,2911,2912],{"class":1185},"    category ",[1117,2914,1189],{"class":1151},[1117,2916,1855],{"class":1185},[1117,2918,1195],{"class":1151},[1117,2920,1903],{"class":1198},[1117,2922,1165],{"class":1151},[1117,2924,2925],{"class":1198},"Category",[1117,2927,1172],{"class":1151},[1117,2929,1913],{"class":1797},[1117,2931,1189],{"class":1151},[1117,2933,1839],{"class":1198},[1117,2935,1195],{"class":1151},[1117,2937,1923],{"class":1922},[1117,2939,1300],{"class":1151},[1117,2941,2942],{"class":1119,"line":2347},[1117,2943,1957],{"class":1185},[1117,2945,2946,2948,2951,2953,2955,2957,2960],{"class":1119,"line":2354},[1117,2947,1158],{"class":1143},[1117,2949,2950],{"class":1161}," get_discounted_price",[1117,2952,1165],{"class":1151},[1117,2954,1169],{"class":1168},[1117,2956,1172],{"class":1151},[1117,2958,2959],{"class":1175}," discount_percent",[1117,2961,1179],{"class":1151},[1117,2963,2964,2966,2968,2970,2973,2976,2979,2982,2985,2988,2991,2994],{"class":1119,"line":2361},[1117,2965,1212],{"class":1211},[1117,2967,1979],{"class":1978},[1117,2969,1195],{"class":1151},[1117,2971,2972],{"class":1984},"price",[1117,2974,2975],{"class":1647}," *",[1117,2977,2978],{"class":1151}," (",[1117,2980,2981],{"class":1870},"1",[1117,2983,2984],{"class":1647}," -",[1117,2986,2987],{"class":1185}," discount_percent ",[1117,2989,2990],{"class":1647},"/",[1117,2992,2993],{"class":1870}," 100",[1117,2995,1300],{"class":1151},[1117,2997,2998],{"class":1119,"line":2366},[1117,2999,1131],{"emptyLinePlaceholder":1130},[1117,3001,3002],{"class":1119,"line":2372},[1117,3003,3004],{"class":1123},"# 5. Template Rendering (MVT Template = MVC View)\n",[1117,3006,3007],{"class":1119,"line":2378},[1117,3008,3009],{"class":1123},"# products/detail.html\n",[1117,3011,3012],{"class":1119,"line":2384},[1117,3013,2351],{"class":2350},[1117,3015,3016],{"class":1119,"line":2390},[1117,3017,2358],{"class":2357},[1117,3019,3020],{"class":1119,"line":2396},[1117,3021,1131],{"emptyLinePlaceholder":1130},[1117,3023,3024],{"class":1119,"line":2402},[1117,3025,2369],{"class":2357},[1117,3027,3028],{"class":1119,"line":2408},[1117,3029,3030],{"class":2357},"    \u003Cdiv class=\"product-detail\">\n",[1117,3032,3033],{"class":1119,"line":2414},[1117,3034,3035],{"class":2357},"        \u003Ch1>{{ product.name }}\u003C/h1>\n",[1117,3037,3038],{"class":1119,"line":2420},[1117,3039,3040],{"class":2357},"        \u003Cp class=\"price\">${{ product.price }}\u003C/p>\n",[1117,3042,3044],{"class":1119,"line":3043},48,[1117,3045,3046],{"class":2357},"        \n",[1117,3048,3050],{"class":1119,"line":3049},49,[1117,3051,3052],{"class":2357},"        \u003Ch3>Related Products\u003C/h3>\n",[1117,3054,3056],{"class":1119,"line":3055},50,[1117,3057,3058],{"class":2357},"        {% for related in related_products %}\n",[1117,3060,3062],{"class":1119,"line":3061},51,[1117,3063,3064],{"class":2357},"            \u003Cdiv class=\"related-product\">\n",[1117,3066,3068],{"class":1119,"line":3067},52,[1117,3069,3070],{"class":2357},"                \u003Ca href=\"{{ related.get_absolute_url }}\">{{ related.name }}\u003C/a>\n",[1117,3072,3074],{"class":1119,"line":3073},53,[1117,3075,3076],{"class":2357},"            \u003C/div>\n",[1117,3078,3080],{"class":1119,"line":3079},54,[1117,3081,3082],{"class":2357},"        {% endfor %}\n",[1117,3084,3086],{"class":1119,"line":3085},55,[1117,3087,3088],{"class":2357},"    \u003C/div>\n",[1117,3090,3092],{"class":1119,"line":3091},56,[1117,3093,2417],{"class":2357},[1117,3095,3097],{"class":1119,"line":3096},57,[1117,3098,2351],{"class":2350},[1030,3100,3102],{"id":3101},"advantages-of-djangos-mvt","Advantages of Django's MVT",[1038,3104,3106],{"id":3105},"_1-framework-managed-controller","1. Framework-Managed Controller",[1026,3108,3109],{},"Django handles the controller logic automatically:",[1049,3111,3112,3118,3124,3130],{},[1052,3113,3114,3117],{},[1045,3115,3116],{},"URL routing"," is declarative and clean",[1052,3119,3120,3123],{},[1045,3121,3122],{},"Middleware system"," provides cross-cutting concerns",[1052,3125,3126,3129],{},[1045,3127,3128],{},"Request/response handling"," is standardized",[1052,3131,3132,3135],{},[1045,3133,3134],{},"Error handling"," is built-in",[1038,3137,3139],{"id":3138},"_2-flexible-view-layer","2. Flexible View Layer",[1026,3141,3142],{},"Views can be functions or classes:",[1107,3144,3146],{"className":1109,"code":3145,"language":1111,"meta":1112,"style":1112},"# Function-based view\ndef product_list(request):\n    products = Product.objects.all()\n    return render(request, 'products/list.html', {'products': products})\n\n# Class-based view\nclass ProductListView(ListView):\n    model = Product\n    template_name = 'products/list.html'\n    context_object_name = 'products'\n    paginate_by = 10\n",[1114,3147,3148,3153,3166,3186,3221,3225,3230,3244,3253,3265,3277],{"__ignoreMap":1112},[1117,3149,3150],{"class":1119,"line":1120},[1117,3151,3152],{"class":1123},"# Function-based view\n",[1117,3154,3155,3157,3160,3162,3164],{"class":1119,"line":1127},[1117,3156,2058],{"class":1143},[1117,3158,3159],{"class":1161}," product_list",[1117,3161,1165],{"class":1151},[1117,3163,2066],{"class":1175},[1117,3165,1179],{"class":1151},[1117,3167,3168,3171,3173,3175,3177,3179,3181,3184],{"class":1119,"line":1134},[1117,3169,3170],{"class":1185},"    products ",[1117,3172,1189],{"class":1151},[1117,3174,2752],{"class":1185},[1117,3176,1195],{"class":1151},[1117,3178,2757],{"class":1984},[1117,3180,1195],{"class":1151},[1117,3182,3183],{"class":1198},"all",[1117,3185,1669],{"class":1151},[1117,3187,3188,3190,3192,3194,3196,3198,3200,3203,3205,3207,3209,3211,3213,3215,3217,3219],{"class":1119,"line":1140},[1117,3189,2128],{"class":1211},[1117,3191,1335],{"class":1198},[1117,3193,1165],{"class":1151},[1117,3195,2066],{"class":1198},[1117,3197,1172],{"class":1151},[1117,3199,2139],{"class":1290},[1117,3201,3202],{"class":1294},"products/list.html",[1117,3204,2014],{"class":1290},[1117,3206,1172],{"class":1151},[1117,3208,1367],{"class":1151},[1117,3210,2014],{"class":1290},[1117,3212,1225],{"class":1294},[1117,3214,2014],{"class":1290},[1117,3216,1376],{"class":1151},[1117,3218,1379],{"class":1198},[1117,3220,1382],{"class":1151},[1117,3222,3223],{"class":1119,"line":1155},[1117,3224,1131],{"emptyLinePlaceholder":1130},[1117,3226,3227],{"class":1119,"line":1182},[1117,3228,3229],{"class":1123},"# Class-based view\n",[1117,3231,3232,3234,3237,3239,3242],{"class":1119,"line":1208},[1117,3233,1144],{"class":1143},[1117,3235,3236],{"class":1147}," ProductListView",[1117,3238,1165],{"class":1151},[1117,3240,3241],{"class":1838},"ListView",[1117,3243,1179],{"class":1151},[1117,3245,3246,3248,3250],{"class":1119,"line":1234},[1117,3247,2186],{"class":1185},[1117,3249,1189],{"class":1151},[1117,3251,3252],{"class":1185}," Product\n",[1117,3254,3255,3257,3259,3261,3263],{"class":1119,"line":1239},[1117,3256,2197],{"class":1185},[1117,3258,1189],{"class":1151},[1117,3260,2139],{"class":1290},[1117,3262,3202],{"class":1294},[1117,3264,2206],{"class":1290},[1117,3266,3267,3269,3271,3273,3275],{"class":1119,"line":1245},[1117,3268,2212],{"class":1185},[1117,3270,1189],{"class":1151},[1117,3272,2139],{"class":1290},[1117,3274,1225],{"class":1294},[1117,3276,2206],{"class":1290},[1117,3278,3279,3282,3284],{"class":1119,"line":1254},[1117,3280,3281],{"class":1185},"    paginate_by ",[1117,3283,1189],{"class":1151},[1117,3285,3286],{"class":1870}," 10\n",[1038,3288,3290],{"id":3289},"_3-powerful-template-system","3. Powerful Template System",[1026,3292,3293],{},"Templates provide clean separation:",[1107,3295,3299],{"className":3296,"code":3297,"language":3298,"meta":1112,"style":1112},"language-html shiki shiki-themes material-theme-lighter vitesse-light vitesse-dark","\u003C!-- Template inheritance -->\n{% extends 'base.html' %}\n\n\u003C!-- Template inclusion -->\n{% include 'partials/product_card.html' %}\n\n\u003C!-- Template filters -->\n{{ product.price|floatformat:2 }}\n\n\u003C!-- Template tags -->\n{% for product in products %}\n    {% if product.is_available %}\n        \u003Cdiv>{{ product.name }}\u003C/div>\n    {% endif %}\n{% endfor %}\n","html",[1114,3300,3301,3306,3310,3314,3319,3324,3328,3333,3338,3342,3347,3352,3357,3380,3385],{"__ignoreMap":1112},[1117,3302,3303],{"class":1119,"line":1120},[1117,3304,3305],{"class":1123},"\u003C!-- Template inheritance -->\n",[1117,3307,3308],{"class":1119,"line":1127},[1117,3309,2358],{"class":1185},[1117,3311,3312],{"class":1119,"line":1134},[1117,3313,1131],{"emptyLinePlaceholder":1130},[1117,3315,3316],{"class":1119,"line":1140},[1117,3317,3318],{"class":1123},"\u003C!-- Template inclusion -->\n",[1117,3320,3321],{"class":1119,"line":1155},[1117,3322,3323],{"class":1185},"{% include 'partials/product_card.html' %}\n",[1117,3325,3326],{"class":1119,"line":1182},[1117,3327,1131],{"emptyLinePlaceholder":1130},[1117,3329,3330],{"class":1119,"line":1208},[1117,3331,3332],{"class":1123},"\u003C!-- Template filters -->\n",[1117,3334,3335],{"class":1119,"line":1234},[1117,3336,3337],{"class":1185},"{{ product.price|floatformat:2 }}\n",[1117,3339,3340],{"class":1119,"line":1239},[1117,3341,1131],{"emptyLinePlaceholder":1130},[1117,3343,3344],{"class":1119,"line":1245},[1117,3345,3346],{"class":1123},"\u003C!-- Template tags -->\n",[1117,3348,3349],{"class":1119,"line":1254},[1117,3350,3351],{"class":1185},"{% for product in products %}\n",[1117,3353,3354],{"class":1119,"line":1264},[1117,3355,3356],{"class":1185},"    {% if product.is_available %}\n",[1117,3358,3359,3362,3366,3369,3372,3375,3377],{"class":1119,"line":1275},[1117,3360,3361],{"class":1151},"        \u003C",[1117,3363,3365],{"class":3364},"sJFLg","div",[1117,3367,3368],{"class":1151},">",[1117,3370,3371],{"class":1185},"{{ product.name }}",[1117,3373,3374],{"class":1151},"\u003C/",[1117,3376,3365],{"class":3364},[1117,3378,3379],{"class":1151},">\n",[1117,3381,3382],{"class":1119,"line":1303},[1117,3383,3384],{"class":1185},"    {% endif %}\n",[1117,3386,3387],{"class":1119,"line":1308},[1117,3388,3389],{"class":1185},"{% endfor %}\n",[1038,3391,3393],{"id":3392},"_4-reusable-components","4. Reusable Components",[1026,3395,3396],{},"MVT promotes reusability:",[1107,3398,3400],{"className":1109,"code":3399,"language":1111,"meta":1112,"style":1112},"# Reusable model across apps\nclass TimeStampedModel(models.Model):\n    created_at = models.DateTimeField(auto_now_add=True)\n    updated_at = models.DateTimeField(auto_now=True)\n    \n    class Meta:\n        abstract = True\n\n# Reusable view mixins\nclass LoginRequiredMixin:\n    def dispatch(self, request, *args, **kwargs):\n        if not request.user.is_authenticated:\n            return redirect('login')\n        return super().dispatch(request, *args, **kwargs)\n\n# Reusable templates\n{% extends 'base.html' %}\n{% include 'partials/pagination.html' %}\n",[1114,3401,3402,3407,3424,3446,3470,3474,3484,3494,3498,3503,3512,3542,3562,3580,3609,3613,3618,3641],{"__ignoreMap":1112},[1117,3403,3404],{"class":1119,"line":1120},[1117,3405,3406],{"class":1123},"# Reusable model across apps\n",[1117,3408,3409,3411,3414,3416,3418,3420,3422],{"class":1119,"line":1127},[1117,3410,1144],{"class":1143},[1117,3412,3413],{"class":1147}," TimeStampedModel",[1117,3415,1165],{"class":1151},[1117,3417,1839],{"class":1838},[1117,3419,1195],{"class":1151},[1117,3421,1516],{"class":1838},[1117,3423,1179],{"class":1151},[1117,3425,3426,3428,3430,3432,3434,3436,3438,3440,3442,3444],{"class":1119,"line":1134},[1117,3427,1930],{"class":1185},[1117,3429,1189],{"class":1151},[1117,3431,1855],{"class":1185},[1117,3433,1195],{"class":1151},[1117,3435,1939],{"class":1198},[1117,3437,1165],{"class":1151},[1117,3439,1944],{"class":1797},[1117,3441,1189],{"class":1151},[1117,3443,1950],{"class":1949},[1117,3445,1300],{"class":1151},[1117,3447,3448,3451,3453,3455,3457,3459,3461,3464,3466,3468],{"class":1119,"line":1140},[1117,3449,3450],{"class":1185},"    updated_at ",[1117,3452,1189],{"class":1151},[1117,3454,1855],{"class":1185},[1117,3456,1195],{"class":1151},[1117,3458,1939],{"class":1198},[1117,3460,1165],{"class":1151},[1117,3462,3463],{"class":1797},"auto_now",[1117,3465,1189],{"class":1151},[1117,3467,1950],{"class":1949},[1117,3469,1300],{"class":1151},[1117,3471,3472],{"class":1119,"line":1155},[1117,3473,1957],{"class":1185},[1117,3475,3476,3479,3482],{"class":1119,"line":1182},[1117,3477,3478],{"class":1143},"    class",[1117,3480,3481],{"class":1147}," Meta",[1117,3483,1152],{"class":1151},[1117,3485,3486,3489,3491],{"class":1119,"line":1208},[1117,3487,3488],{"class":1185},"        abstract ",[1117,3490,1189],{"class":1151},[1117,3492,3493],{"class":1949}," True\n",[1117,3495,3496],{"class":1119,"line":1234},[1117,3497,1131],{"emptyLinePlaceholder":1130},[1117,3499,3500],{"class":1119,"line":1239},[1117,3501,3502],{"class":1123},"# Reusable view mixins\n",[1117,3504,3505,3507,3510],{"class":1119,"line":1245},[1117,3506,1144],{"class":1143},[1117,3508,3509],{"class":1147}," LoginRequiredMixin",[1117,3511,1152],{"class":1151},[1117,3513,3514,3516,3519,3521,3523,3525,3527,3529,3531,3534,3536,3538,3540],{"class":1119,"line":1254},[1117,3515,1158],{"class":1143},[1117,3517,3518],{"class":1161}," dispatch",[1117,3520,1165],{"class":1151},[1117,3522,1169],{"class":1168},[1117,3524,1172],{"class":1151},[1117,3526,1176],{"class":1175},[1117,3528,1172],{"class":1151},[1117,3530,2975],{"class":1647},[1117,3532,3533],{"class":1175},"args",[1117,3535,1172],{"class":1151},[1117,3537,2699],{"class":1647},[1117,3539,2702],{"class":1175},[1117,3541,1179],{"class":1151},[1117,3543,3544,3546,3548,3550,3552,3555,3557,3560],{"class":1119,"line":1264},[1117,3545,1644],{"class":1211},[1117,3547,1648],{"class":1647},[1117,3549,1176],{"class":1185},[1117,3551,1195],{"class":1151},[1117,3553,3554],{"class":1984},"user",[1117,3556,1195],{"class":1151},[1117,3558,3559],{"class":1984},"is_authenticated",[1117,3561,1152],{"class":1151},[1117,3563,3564,3566,3569,3571,3573,3576,3578],{"class":1119,"line":1275},[1117,3565,1658],{"class":1211},[1117,3567,3568],{"class":1198}," redirect",[1117,3570,1165],{"class":1151},[1117,3572,2014],{"class":1290},[1117,3574,3575],{"class":1294},"login",[1117,3577,2014],{"class":1290},[1117,3579,1300],{"class":1151},[1117,3581,3582,3584,3586,3588,3591,3593,3595,3597,3599,3601,3603,3605,3607],{"class":1119,"line":1303},[1117,3583,1212],{"class":1211},[1117,3585,2714],{"class":1260},[1117,3587,2717],{"class":1151},[1117,3589,3590],{"class":1198},"dispatch",[1117,3592,1165],{"class":1151},[1117,3594,2066],{"class":1198},[1117,3596,1172],{"class":1151},[1117,3598,2975],{"class":1647},[1117,3600,3533],{"class":1198},[1117,3602,1172],{"class":1151},[1117,3604,2699],{"class":1647},[1117,3606,2702],{"class":1198},[1117,3608,1300],{"class":1151},[1117,3610,3611],{"class":1119,"line":1308},[1117,3612,1131],{"emptyLinePlaceholder":1130},[1117,3614,3615],{"class":1119,"line":1314},[1117,3616,3617],{"class":1123},"# Reusable templates\n",[1117,3619,3620,3623,3626,3629,3631,3634,3636,3639],{"class":1119,"line":1323},[1117,3621,3622],{"class":1151},"{",[1117,3624,3625],{"class":1647},"%",[1117,3627,3628],{"class":1185}," extends ",[1117,3630,2014],{"class":1290},[1117,3632,3633],{"class":1294},"base.html",[1117,3635,2014],{"class":1290},[1117,3637,3638],{"class":1647}," %",[1117,3640,2122],{"class":1151},[1117,3642,3643,3645,3647,3650,3652,3655,3657,3659],{"class":1119,"line":1330},[1117,3644,3622],{"class":1151},[1117,3646,3625],{"class":1647},[1117,3648,3649],{"class":1185}," include ",[1117,3651,2014],{"class":1290},[1117,3653,3654],{"class":1294},"partials/pagination.html",[1117,3656,2014],{"class":1290},[1117,3658,3638],{"class":1647},[1117,3660,2122],{"class":1151},[1030,3662,3664],{"id":3663},"when-to-use-each-pattern","When to Use Each Pattern",[1038,3666,3668],{"id":3667},"traditional-mvc-works-well-for","Traditional MVC Works Well For:",[1049,3670,3671,3674,3677,3680],{},[1052,3672,3673],{},"Desktop applications",[1052,3675,3676],{},"Complex client-side applications",[1052,3678,3679],{},"Applications with heavy client-side logic",[1052,3681,3682],{},"Non-web applications",[1038,3684,3686],{"id":3685},"django-mvt-excels-at","Django MVT Excels At:",[1049,3688,3689,3692,3695,3698,3701],{},[1052,3690,3691],{},"Web applications",[1052,3693,3694],{},"Content management systems",[1052,3696,3697],{},"API backends",[1052,3699,3700],{},"Rapid prototyping",[1052,3702,3703],{},"Applications with server-side rendering",[1030,3705,3707],{"id":3706},"common-misconceptions","Common Misconceptions",[1038,3709,3711],{"id":3710},"django-doesnt-have-controllers","\"Django Doesn't Have Controllers\"",[1026,3713,3714,3717],{},[1045,3715,3716],{},"Reality",": Django's URL dispatcher and framework core act as controllers, plus views handle controller responsibilities.",[1038,3719,3721],{"id":3720},"templates-are-just-views","\"Templates Are Just Views\"",[1026,3723,3724,3726],{},[1045,3725,3716],{},": Templates handle presentation logic but are more powerful than traditional views, with inheritance, inclusion, and custom tags.",[1038,3728,3730],{"id":3729},"mvt-is-just-renamed-mvc","\"MVT Is Just Renamed MVC\"",[1026,3732,3733,3735],{},[1045,3734,3716],{},": MVT reflects Django's specific implementation where the framework handles controller concerns, allowing developers to focus on business logic.",[1030,3737,3739],{"id":3738},"best-practices-for-django-mvt","Best Practices for Django MVT",[1038,3741,3743],{"id":3742},"_1-keep-views-focused","1. Keep Views Focused",[1107,3745,3747],{"className":1109,"code":3746,"language":1111,"meta":1112,"style":1112},"# Good: Focused view\ndef create_order(request):\n    if request.method == 'POST':\n        form = OrderForm(request.POST)\n        if form.is_valid():\n            order = form.save(commit=False)\n            order.user = request.user\n            order.save()\n            return redirect('order_success')\n    else:\n        form = OrderForm()\n    return render(request, 'orders/create.html', {'form': form})\n\n# Better: Use class-based view\nclass OrderCreateView(LoginRequiredMixin, CreateView):\n    model = Order\n    form_class = OrderForm\n    template_name = 'orders/create.html'\n    success_url = reverse_lazy('order_success')\n    \n    def form_valid(self, form):\n        form.instance.user = self.request.user\n        return super().form_valid(form)\n",[1114,3748,3749,3754,3767,3791,3811,3825,3851,3869,3879,3896,3903,3913,3949,3953,3958,3977,3986,3996,4008,4028,4032,4049,4075],{"__ignoreMap":1112},[1117,3750,3751],{"class":1119,"line":1120},[1117,3752,3753],{"class":1123},"# Good: Focused view\n",[1117,3755,3756,3758,3761,3763,3765],{"class":1119,"line":1127},[1117,3757,2058],{"class":1143},[1117,3759,3760],{"class":1161}," create_order",[1117,3762,1165],{"class":1151},[1117,3764,2066],{"class":1175},[1117,3766,1179],{"class":1151},[1117,3768,3769,3772,3774,3776,3779,3782,3784,3787,3789],{"class":1119,"line":1134},[1117,3770,3771],{"class":1211},"    if",[1117,3773,1176],{"class":1185},[1117,3775,1195],{"class":1151},[1117,3777,3778],{"class":1984},"method",[1117,3780,3781],{"class":1647}," ==",[1117,3783,2139],{"class":1290},[1117,3785,3786],{"class":1294},"POST",[1117,3788,2014],{"class":1290},[1117,3790,1152],{"class":1151},[1117,3792,3793,3796,3798,3801,3803,3805,3807,3809],{"class":1119,"line":1140},[1117,3794,3795],{"class":1185},"        form ",[1117,3797,1189],{"class":1151},[1117,3799,3800],{"class":1198}," OrderForm",[1117,3802,1165],{"class":1151},[1117,3804,2066],{"class":1198},[1117,3806,1195],{"class":1151},[1117,3808,3786],{"class":1922},[1117,3810,1300],{"class":1151},[1117,3812,3813,3815,3818,3820,3823],{"class":1119,"line":1155},[1117,3814,1644],{"class":1211},[1117,3816,3817],{"class":1185}," form",[1117,3819,1195],{"class":1151},[1117,3821,3822],{"class":1198},"is_valid",[1117,3824,1272],{"class":1151},[1117,3826,3827,3830,3832,3834,3836,3839,3841,3844,3846,3849],{"class":1119,"line":1182},[1117,3828,3829],{"class":1185},"            order ",[1117,3831,1189],{"class":1151},[1117,3833,3817],{"class":1185},[1117,3835,1195],{"class":1151},[1117,3837,3838],{"class":1198},"save",[1117,3840,1165],{"class":1151},[1117,3842,3843],{"class":1797},"commit",[1117,3845,1189],{"class":1151},[1117,3847,3848],{"class":1949},"False",[1117,3850,1300],{"class":1151},[1117,3852,3853,3856,3858,3860,3862,3864,3866],{"class":1119,"line":1208},[1117,3854,3855],{"class":1185},"            order",[1117,3857,1195],{"class":1151},[1117,3859,3554],{"class":1984},[1117,3861,2569],{"class":1151},[1117,3863,1176],{"class":1185},[1117,3865,1195],{"class":1151},[1117,3867,3868],{"class":1984},"user\n",[1117,3870,3871,3873,3875,3877],{"class":1119,"line":1234},[1117,3872,3855],{"class":1185},[1117,3874,1195],{"class":1151},[1117,3876,3838],{"class":1198},[1117,3878,1669],{"class":1151},[1117,3880,3881,3883,3885,3887,3889,3892,3894],{"class":1119,"line":1239},[1117,3882,1658],{"class":1211},[1117,3884,3568],{"class":1198},[1117,3886,1165],{"class":1151},[1117,3888,2014],{"class":1290},[1117,3890,3891],{"class":1294},"order_success",[1117,3893,2014],{"class":1290},[1117,3895,1300],{"class":1151},[1117,3897,3898,3901],{"class":1119,"line":1245},[1117,3899,3900],{"class":1211},"    else",[1117,3902,1152],{"class":1151},[1117,3904,3905,3907,3909,3911],{"class":1119,"line":1254},[1117,3906,3795],{"class":1185},[1117,3908,1189],{"class":1151},[1117,3910,3800],{"class":1198},[1117,3912,1669],{"class":1151},[1117,3914,3915,3917,3919,3921,3923,3925,3927,3930,3932,3934,3936,3938,3941,3943,3945,3947],{"class":1119,"line":1264},[1117,3916,2128],{"class":1211},[1117,3918,1335],{"class":1198},[1117,3920,1165],{"class":1151},[1117,3922,2066],{"class":1198},[1117,3924,1172],{"class":1151},[1117,3926,2139],{"class":1290},[1117,3928,3929],{"class":1294},"orders/create.html",[1117,3931,2014],{"class":1290},[1117,3933,1172],{"class":1151},[1117,3935,1367],{"class":1151},[1117,3937,2014],{"class":1290},[1117,3939,3940],{"class":1294},"form",[1117,3942,2014],{"class":1290},[1117,3944,1376],{"class":1151},[1117,3946,3817],{"class":1198},[1117,3948,1382],{"class":1151},[1117,3950,3951],{"class":1119,"line":1275},[1117,3952,1131],{"emptyLinePlaceholder":1130},[1117,3954,3955],{"class":1119,"line":1303},[1117,3956,3957],{"class":1123},"# Better: Use class-based view\n",[1117,3959,3960,3962,3965,3967,3970,3972,3975],{"class":1119,"line":1308},[1117,3961,1144],{"class":1143},[1117,3963,3964],{"class":1147}," OrderCreateView",[1117,3966,1165],{"class":1151},[1117,3968,3969],{"class":1838},"LoginRequiredMixin",[1117,3971,1172],{"class":1151},[1117,3973,3974],{"class":1838}," CreateView",[1117,3976,1179],{"class":1151},[1117,3978,3979,3981,3983],{"class":1119,"line":1314},[1117,3980,2186],{"class":1185},[1117,3982,1189],{"class":1151},[1117,3984,3985],{"class":1185}," Order\n",[1117,3987,3988,3991,3993],{"class":1119,"line":1323},[1117,3989,3990],{"class":1185},"    form_class ",[1117,3992,1189],{"class":1151},[1117,3994,3995],{"class":1185}," OrderForm\n",[1117,3997,3998,4000,4002,4004,4006],{"class":1119,"line":1330},[1117,3999,2197],{"class":1185},[1117,4001,1189],{"class":1151},[1117,4003,2139],{"class":1290},[1117,4005,3929],{"class":1294},[1117,4007,2206],{"class":1290},[1117,4009,4010,4013,4015,4018,4020,4022,4024,4026],{"class":1119,"line":1344},[1117,4011,4012],{"class":1185},"    success_url ",[1117,4014,1189],{"class":1151},[1117,4016,4017],{"class":1198}," reverse_lazy",[1117,4019,1165],{"class":1151},[1117,4021,2014],{"class":1290},[1117,4023,3891],{"class":1294},[1117,4025,2014],{"class":1290},[1117,4027,1300],{"class":1151},[1117,4029,4030],{"class":1119,"line":2125},[1117,4031,1957],{"class":1185},[1117,4033,4034,4036,4039,4041,4043,4045,4047],{"class":1119,"line":2157},[1117,4035,1158],{"class":1143},[1117,4037,4038],{"class":1161}," form_valid",[1117,4040,1165],{"class":1151},[1117,4042,1169],{"class":1168},[1117,4044,1172],{"class":1151},[1117,4046,3817],{"class":1175},[1117,4048,1179],{"class":1151},[1117,4050,4051,4054,4056,4059,4061,4063,4065,4067,4069,4071,4073],{"class":1119,"line":2162},[1117,4052,4053],{"class":1185},"        form",[1117,4055,1195],{"class":1151},[1117,4057,4058],{"class":1984},"instance",[1117,4060,1195],{"class":1151},[1117,4062,3554],{"class":1984},[1117,4064,2569],{"class":1151},[1117,4066,1979],{"class":1978},[1117,4068,1195],{"class":1151},[1117,4070,2066],{"class":1984},[1117,4072,1195],{"class":1151},[1117,4074,3868],{"class":1984},[1117,4076,4077,4079,4081,4083,4086,4088,4090],{"class":1119,"line":2168},[1117,4078,1212],{"class":1211},[1117,4080,2714],{"class":1260},[1117,4082,2717],{"class":1151},[1117,4084,4085],{"class":1198},"form_valid",[1117,4087,1165],{"class":1151},[1117,4089,3940],{"class":1198},[1117,4091,1300],{"class":1151},[1038,4093,4095],{"id":4094},"_2-fat-models-thin-views","2. Fat Models, Thin Views",[1107,4097,4099],{"className":1109,"code":4098,"language":1111,"meta":1112,"style":1112},"# Good: Business logic in model\nclass Order(models.Model):\n    user = models.ForeignKey(User, on_delete=models.CASCADE)\n    total = models.DecimalField(max_digits=10, decimal_places=2)\n    status = models.CharField(max_length=20, default='pending')\n    \n    def calculate_total(self):\n        return sum(item.subtotal for item in self.items.all())\n    \n    def can_be_cancelled(self):\n        return self.status in ['pending', 'confirmed']\n    \n    def cancel(self):\n        if self.can_be_cancelled():\n            self.status = 'cancelled'\n            self.save()\n            return True\n        return False\n\n# Thin view\ndef cancel_order(request, order_id):\n    order = get_object_or_404(Order, id=order_id, user=request.user)\n    if order.cancel():\n        messages.success(request, 'Order cancelled successfully.')\n    else:\n        messages.error(request, 'Order cannot be cancelled.')\n    return redirect('order_detail', order_id=order.id)\n",[1114,4100,4101,4106,4123,4154,4185,4223,4227,4240,4280,4284,4297,4331,4335,4348,4361,4379,4389,4395,4402,4406,4411,4429,4468,4482,4507,4513,4537],{"__ignoreMap":1112},[1117,4102,4103],{"class":1119,"line":1120},[1117,4104,4105],{"class":1123},"# Good: Business logic in model\n",[1117,4107,4108,4110,4113,4115,4117,4119,4121],{"class":1119,"line":1127},[1117,4109,1144],{"class":1143},[1117,4111,4112],{"class":1147}," Order",[1117,4114,1165],{"class":1151},[1117,4116,1839],{"class":1838},[1117,4118,1195],{"class":1151},[1117,4120,1516],{"class":1838},[1117,4122,1179],{"class":1151},[1117,4124,4125,4128,4130,4132,4134,4136,4138,4140,4142,4144,4146,4148,4150,4152],{"class":1119,"line":1134},[1117,4126,4127],{"class":1185},"    user ",[1117,4129,1189],{"class":1151},[1117,4131,1855],{"class":1185},[1117,4133,1195],{"class":1151},[1117,4135,1903],{"class":1198},[1117,4137,1165],{"class":1151},[1117,4139,1908],{"class":1198},[1117,4141,1172],{"class":1151},[1117,4143,1913],{"class":1797},[1117,4145,1189],{"class":1151},[1117,4147,1839],{"class":1198},[1117,4149,1195],{"class":1151},[1117,4151,1923],{"class":1922},[1117,4153,1300],{"class":1151},[1117,4155,4156,4159,4161,4163,4165,4167,4169,4171,4173,4175,4177,4179,4181,4183],{"class":1119,"line":1140},[1117,4157,4158],{"class":1185},"    total ",[1117,4160,1189],{"class":1151},[1117,4162,1855],{"class":1185},[1117,4164,1195],{"class":1151},[1117,4166,2885],{"class":1198},[1117,4168,1165],{"class":1151},[1117,4170,2890],{"class":1797},[1117,4172,1189],{"class":1151},[1117,4174,2895],{"class":1870},[1117,4176,1172],{"class":1151},[1117,4178,2900],{"class":1797},[1117,4180,1189],{"class":1151},[1117,4182,2905],{"class":1870},[1117,4184,1300],{"class":1151},[1117,4186,4187,4190,4192,4194,4196,4198,4200,4202,4204,4207,4209,4212,4214,4216,4219,4221],{"class":1119,"line":1155},[1117,4188,4189],{"class":1185},"    status ",[1117,4191,1189],{"class":1151},[1117,4193,1855],{"class":1185},[1117,4195,1195],{"class":1151},[1117,4197,1860],{"class":1198},[1117,4199,1165],{"class":1151},[1117,4201,1865],{"class":1797},[1117,4203,1189],{"class":1151},[1117,4205,4206],{"class":1870},"20",[1117,4208,1172],{"class":1151},[1117,4210,4211],{"class":1797}," default",[1117,4213,1189],{"class":1151},[1117,4215,2014],{"class":1290},[1117,4217,4218],{"class":1294},"pending",[1117,4220,2014],{"class":1290},[1117,4222,1300],{"class":1151},[1117,4224,4225],{"class":1119,"line":1182},[1117,4226,1957],{"class":1185},[1117,4228,4229,4231,4234,4236,4238],{"class":1119,"line":1208},[1117,4230,1158],{"class":1143},[1117,4232,4233],{"class":1161}," calculate_total",[1117,4235,1165],{"class":1151},[1117,4237,1169],{"class":1168},[1117,4239,1179],{"class":1151},[1117,4241,4242,4244,4247,4249,4252,4254,4257,4260,4263,4266,4268,4270,4273,4275,4277],{"class":1119,"line":1234},[1117,4243,1212],{"class":1211},[1117,4245,4246],{"class":1964}," sum",[1117,4248,1165],{"class":1151},[1117,4250,4251],{"class":1198},"item",[1117,4253,1195],{"class":1151},[1117,4255,4256],{"class":1984},"subtotal",[1117,4258,4259],{"class":1211}," for",[1117,4261,4262],{"class":1198}," item ",[1117,4264,4265],{"class":1211},"in",[1117,4267,1979],{"class":1978},[1117,4269,1195],{"class":1151},[1117,4271,4272],{"class":1984},"items",[1117,4274,1195],{"class":1151},[1117,4276,3183],{"class":1198},[1117,4278,4279],{"class":1151},"())\n",[1117,4281,4282],{"class":1119,"line":1239},[1117,4283,1957],{"class":1185},[1117,4285,4286,4288,4291,4293,4295],{"class":1119,"line":1245},[1117,4287,1158],{"class":1143},[1117,4289,4290],{"class":1161}," can_be_cancelled",[1117,4292,1165],{"class":1151},[1117,4294,1169],{"class":1168},[1117,4296,1179],{"class":1151},[1117,4298,4299,4301,4303,4305,4308,4311,4314,4316,4318,4320,4322,4324,4327,4329],{"class":1119,"line":1254},[1117,4300,1212],{"class":1211},[1117,4302,1979],{"class":1978},[1117,4304,1195],{"class":1151},[1117,4306,4307],{"class":1984},"status",[1117,4309,4310],{"class":1647}," in",[1117,4312,4313],{"class":1151}," [",[1117,4315,2014],{"class":1290},[1117,4317,4218],{"class":1294},[1117,4319,2014],{"class":1290},[1117,4321,1172],{"class":1151},[1117,4323,2139],{"class":1290},[1117,4325,4326],{"class":1294},"confirmed",[1117,4328,2014],{"class":1290},[1117,4330,2333],{"class":1151},[1117,4332,4333],{"class":1119,"line":1264},[1117,4334,1957],{"class":1185},[1117,4336,4337,4339,4342,4344,4346],{"class":1119,"line":1275},[1117,4338,1158],{"class":1143},[1117,4340,4341],{"class":1161}," cancel",[1117,4343,1165],{"class":1151},[1117,4345,1169],{"class":1168},[1117,4347,1179],{"class":1151},[1117,4349,4350,4352,4354,4356,4359],{"class":1119,"line":1303},[1117,4351,1644],{"class":1211},[1117,4353,1979],{"class":1978},[1117,4355,1195],{"class":1151},[1117,4357,4358],{"class":1198},"can_be_cancelled",[1117,4360,1272],{"class":1151},[1117,4362,4363,4366,4368,4370,4372,4374,4377],{"class":1119,"line":1308},[1117,4364,4365],{"class":1978},"            self",[1117,4367,1195],{"class":1151},[1117,4369,4307],{"class":1984},[1117,4371,2569],{"class":1151},[1117,4373,2139],{"class":1290},[1117,4375,4376],{"class":1294},"cancelled",[1117,4378,2206],{"class":1290},[1117,4380,4381,4383,4385,4387],{"class":1119,"line":1314},[1117,4382,4365],{"class":1978},[1117,4384,1195],{"class":1151},[1117,4386,3838],{"class":1198},[1117,4388,1669],{"class":1151},[1117,4390,4391,4393],{"class":1119,"line":1323},[1117,4392,1658],{"class":1211},[1117,4394,3493],{"class":1949},[1117,4396,4397,4399],{"class":1119,"line":1330},[1117,4398,1212],{"class":1211},[1117,4400,4401],{"class":1949}," False\n",[1117,4403,4404],{"class":1119,"line":1344},[1117,4405,1131],{"emptyLinePlaceholder":1130},[1117,4407,4408],{"class":1119,"line":2125},[1117,4409,4410],{"class":1123},"# Thin view\n",[1117,4412,4413,4415,4418,4420,4422,4424,4427],{"class":1119,"line":2157},[1117,4414,2058],{"class":1143},[1117,4416,4417],{"class":1161}," cancel_order",[1117,4419,1165],{"class":1151},[1117,4421,2066],{"class":1175},[1117,4423,1172],{"class":1151},[1117,4425,4426],{"class":1175}," order_id",[1117,4428,1179],{"class":1151},[1117,4430,4431,4434,4436,4438,4440,4443,4445,4448,4450,4453,4455,4458,4460,4462,4464,4466],{"class":1119,"line":2162},[1117,4432,4433],{"class":1185},"    order ",[1117,4435,1189],{"class":1151},[1117,4437,2082],{"class":1198},[1117,4439,1165],{"class":1151},[1117,4441,4442],{"class":1198},"Order",[1117,4444,1172],{"class":1151},[1117,4446,4447],{"class":1797}," id",[1117,4449,1189],{"class":1151},[1117,4451,4452],{"class":1198},"order_id",[1117,4454,1172],{"class":1151},[1117,4456,4457],{"class":1797}," user",[1117,4459,1189],{"class":1151},[1117,4461,2066],{"class":1198},[1117,4463,1195],{"class":1151},[1117,4465,3554],{"class":1984},[1117,4467,1300],{"class":1151},[1117,4469,4470,4472,4475,4477,4480],{"class":1119,"line":2168},[1117,4471,3771],{"class":1211},[1117,4473,4474],{"class":1185}," order",[1117,4476,1195],{"class":1151},[1117,4478,4479],{"class":1198},"cancel",[1117,4481,1272],{"class":1151},[1117,4483,4484,4487,4489,4492,4494,4496,4498,4500,4503,4505],{"class":1119,"line":2183},[1117,4485,4486],{"class":1185},"        messages",[1117,4488,1195],{"class":1151},[1117,4490,4491],{"class":1198},"success",[1117,4493,1165],{"class":1151},[1117,4495,2066],{"class":1198},[1117,4497,1172],{"class":1151},[1117,4499,2139],{"class":1290},[1117,4501,4502],{"class":1294},"Order cancelled successfully.",[1117,4504,2014],{"class":1290},[1117,4506,1300],{"class":1151},[1117,4508,4509,4511],{"class":1119,"line":2194},[1117,4510,3900],{"class":1211},[1117,4512,1152],{"class":1151},[1117,4514,4515,4517,4519,4522,4524,4526,4528,4530,4533,4535],{"class":1119,"line":2209},[1117,4516,4486],{"class":1185},[1117,4518,1195],{"class":1151},[1117,4520,4521],{"class":1198},"error",[1117,4523,1165],{"class":1151},[1117,4525,2066],{"class":1198},[1117,4527,1172],{"class":1151},[1117,4529,2139],{"class":1290},[1117,4531,4532],{"class":1294},"Order cannot be cancelled.",[1117,4534,2014],{"class":1290},[1117,4536,1300],{"class":1151},[1117,4538,4539,4541,4543,4545,4547,4550,4552,4554,4556,4558,4561,4563,4566],{"class":1119,"line":2223},[1117,4540,2128],{"class":1211},[1117,4542,3568],{"class":1198},[1117,4544,1165],{"class":1151},[1117,4546,2014],{"class":1290},[1117,4548,4549],{"class":1294},"order_detail",[1117,4551,2014],{"class":1290},[1117,4553,1172],{"class":1151},[1117,4555,4426],{"class":1797},[1117,4557,1189],{"class":1151},[1117,4559,4560],{"class":1198},"order",[1117,4562,1195],{"class":1151},[1117,4564,4565],{"class":1984},"id",[1117,4567,1300],{"class":1151},[1038,4569,4571],{"id":4570},"_3-template-organization","3. Template Organization",[1107,4573,4575],{"className":3296,"code":4574,"language":3298,"meta":1112,"style":1112},"\u003C!-- base.html -->\n\u003C!DOCTYPE html>\n\u003Chtml>\n\u003Chead>\n    \u003Ctitle>{% block title %}My Site{% endblock %}\u003C/title>\n    {% block extra_css %}{% endblock %}\n\u003C/head>\n\u003Cbody>\n    {% include 'partials/header.html' %}\n    \u003Cmain>\n        {% block content %}{% endblock %}\n    \u003C/main>\n    {% include 'partials/footer.html' %}\n    {% block extra_js %}{% endblock %}\n\u003C/body>\n\u003C/html>\n\n\u003C!-- products/list.html -->\n{% extends 'base.html' %}\n\n{% block title %}Products - {{ block.super }}{% endblock %}\n\n{% block content %}\n    {% for product in products %}\n        {% include 'partials/product_card.html' %}\n    {% endfor %}\n{% endblock %}\n",[1114,4576,4577,4582,4596,4605,4614,4633,4638,4646,4655,4660,4669,4674,4683,4688,4693,4701,4709,4713,4718,4722,4726,4731,4735,4739,4744,4749,4754],{"__ignoreMap":1112},[1117,4578,4579],{"class":1119,"line":1120},[1117,4580,4581],{"class":1123},"\u003C!-- base.html -->\n",[1117,4583,4584,4587,4590,4594],{"class":1119,"line":1127},[1117,4585,4586],{"class":1151},"\u003C!",[1117,4588,4589],{"class":3364},"DOCTYPE",[1117,4591,4593],{"class":4592},"s5q8q"," html",[1117,4595,3379],{"class":1151},[1117,4597,4598,4601,4603],{"class":1119,"line":1134},[1117,4599,4600],{"class":1151},"\u003C",[1117,4602,3298],{"class":3364},[1117,4604,3379],{"class":1151},[1117,4606,4607,4609,4612],{"class":1119,"line":1140},[1117,4608,4600],{"class":1151},[1117,4610,4611],{"class":3364},"head",[1117,4613,3379],{"class":1151},[1117,4615,4616,4619,4622,4624,4627,4629,4631],{"class":1119,"line":1155},[1117,4617,4618],{"class":1151},"    \u003C",[1117,4620,4621],{"class":3364},"title",[1117,4623,3368],{"class":1151},[1117,4625,4626],{"class":1185},"{% block title %}My Site{% endblock %}",[1117,4628,3374],{"class":1151},[1117,4630,4621],{"class":3364},[1117,4632,3379],{"class":1151},[1117,4634,4635],{"class":1119,"line":1182},[1117,4636,4637],{"class":1185},"    {% block extra_css %}{% endblock %}\n",[1117,4639,4640,4642,4644],{"class":1119,"line":1208},[1117,4641,3374],{"class":1151},[1117,4643,4611],{"class":3364},[1117,4645,3379],{"class":1151},[1117,4647,4648,4650,4653],{"class":1119,"line":1234},[1117,4649,4600],{"class":1151},[1117,4651,4652],{"class":3364},"body",[1117,4654,3379],{"class":1151},[1117,4656,4657],{"class":1119,"line":1239},[1117,4658,4659],{"class":1185},"    {% include 'partials/header.html' %}\n",[1117,4661,4662,4664,4667],{"class":1119,"line":1245},[1117,4663,4618],{"class":1151},[1117,4665,4666],{"class":3364},"main",[1117,4668,3379],{"class":1151},[1117,4670,4671],{"class":1119,"line":1254},[1117,4672,4673],{"class":1185},"        {% block content %}{% endblock %}\n",[1117,4675,4676,4679,4681],{"class":1119,"line":1264},[1117,4677,4678],{"class":1151},"    \u003C/",[1117,4680,4666],{"class":3364},[1117,4682,3379],{"class":1151},[1117,4684,4685],{"class":1119,"line":1275},[1117,4686,4687],{"class":1185},"    {% include 'partials/footer.html' %}\n",[1117,4689,4690],{"class":1119,"line":1303},[1117,4691,4692],{"class":1185},"    {% block extra_js %}{% endblock %}\n",[1117,4694,4695,4697,4699],{"class":1119,"line":1308},[1117,4696,3374],{"class":1151},[1117,4698,4652],{"class":3364},[1117,4700,3379],{"class":1151},[1117,4702,4703,4705,4707],{"class":1119,"line":1314},[1117,4704,3374],{"class":1151},[1117,4706,3298],{"class":3364},[1117,4708,3379],{"class":1151},[1117,4710,4711],{"class":1119,"line":1323},[1117,4712,1131],{"emptyLinePlaceholder":1130},[1117,4714,4715],{"class":1119,"line":1330},[1117,4716,4717],{"class":1123},"\u003C!-- products/list.html -->\n",[1117,4719,4720],{"class":1119,"line":1344},[1117,4721,2358],{"class":1185},[1117,4723,4724],{"class":1119,"line":2125},[1117,4725,1131],{"emptyLinePlaceholder":1130},[1117,4727,4728],{"class":1119,"line":2157},[1117,4729,4730],{"class":1185},"{% block title %}Products - {{ block.super }}{% endblock %}\n",[1117,4732,4733],{"class":1119,"line":2162},[1117,4734,1131],{"emptyLinePlaceholder":1130},[1117,4736,4737],{"class":1119,"line":2168},[1117,4738,2369],{"class":1185},[1117,4740,4741],{"class":1119,"line":2183},[1117,4742,4743],{"class":1185},"    {% for product in products %}\n",[1117,4745,4746],{"class":1119,"line":2194},[1117,4747,4748],{"class":1185},"        {% include 'partials/product_card.html' %}\n",[1117,4750,4751],{"class":1119,"line":2209},[1117,4752,4753],{"class":1185},"    {% endfor %}\n",[1117,4755,4756],{"class":1119,"line":2223},[1117,4757,2417],{"class":1185},[1026,4759,4760],{},"Understanding Django's MVT pattern and how it relates to traditional MVC helps you write better Django applications by leveraging the framework's strengths while maintaining clean, maintainable code architecture.",[4762,4763,4764],"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 .s5Kfy, html code.shiki .s5Kfy{--shiki-light:#9C3EDA;--shiki-default:#AB5959;--shiki-dark:#CB7676}html pre.shiki code .sD-vU, html code.shiki .sD-vU{--shiki-light:#E2931D;--shiki-default:#2E8F82;--shiki-dark:#5DA994}html pre.shiki code .soVBu, html code.shiki .soVBu{--shiki-light:#39ADB5;--shiki-default:#999999;--shiki-dark:#666666}html pre.shiki code .sljsM, html code.shiki .sljsM{--shiki-light:#6182B8;--shiki-default:#59873A;--shiki-dark:#80A665}html pre.shiki code .sRjD_, html code.shiki .sRjD_{--shiki-light:#E53935;--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 .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 .sftqT, html code.shiki .sftqT{--shiki-light:#90A4AE;--shiki-default:#393A34;--shiki-dark:#DBD7CAEE}html pre.shiki code .siWMO, html code.shiki .siWMO{--shiki-light:#6182B8;--shiki-default:#393A34;--shiki-dark:#DBD7CAEE}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}html pre.shiki code .sa2tF, html code.shiki .sa2tF{--shiki-light:#E2931D;--shiki-default:#998418;--shiki-dark:#B8A965}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 .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 .sVsLi, html code.shiki .sVsLi{--shiki-light:#39ADB5;--shiki-default:#AB5959;--shiki-dark:#CB7676}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 pre.shiki code .sYn-s, html code.shiki .sYn-s{--shiki-light:#E2931D;--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 .sFGJz, html code.shiki .sFGJz{--shiki-light:#E53935;--shiki-default:#A65E2B;--shiki-dark:#C99076}html pre.shiki code .s8XtY, html code.shiki .s8XtY{--shiki-light:#39ADB5;--shiki-default:#1E754F;--shiki-dark:#4D9375}html pre.shiki code .sJdAF, html code.shiki .sJdAF{--shiki-light:#6182B8;--shiki-default:#998418;--shiki-dark:#B8A965}html pre.shiki code .se3Ec, html code.shiki .se3Ec{--shiki-light:#90A4AE;--shiki-default:#A65E2B;--shiki-dark:#C99076}html pre.shiki code .sBPpx, html code.shiki .sBPpx{--shiki-light:#E53935;--shiki-default:#393A34;--shiki-dark:#DBD7CAEE}html pre.shiki code .sm7ve, html code.shiki .sm7ve{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#B5695977;--shiki-default-font-style:inherit;--shiki-dark:#C98A7D77;--shiki-dark-font-style:inherit}html pre.shiki code .sVyVU, html code.shiki .sVyVU{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#B56959;--shiki-default-font-style:inherit;--shiki-dark:#C98A7D;--shiki-dark-font-style:inherit}html pre.shiki code .sJFLg, html code.shiki .sJFLg{--shiki-light:#E53935;--shiki-default:#1E754F;--shiki-dark:#4D9375}html pre.shiki code .s5q8q, html code.shiki .s5q8q{--shiki-light:#9C3EDA;--shiki-default:#B07D48;--shiki-dark:#BD976A}",{"title":1112,"searchDepth":1120,"depth":1127,"links":4766},[4767,4771,4775,4776,4780,4784,4785,4791,4795,4800],{"id":1032,"depth":1127,"text":1033,"children":4768},[4769,4770],{"id":1040,"depth":1134,"text":1041},{"id":1104,"depth":1134,"text":1105},{"id":1385,"depth":1127,"text":1386,"children":4772},[4773,4774],{"id":1392,"depth":1134,"text":1393},{"id":1455,"depth":1134,"text":1456},{"id":1482,"depth":1127,"text":1483},{"id":1571,"depth":1127,"text":1572,"children":4777},[4778,4779],{"id":1575,"depth":1134,"text":1576},{"id":1806,"depth":1134,"text":1807},{"id":2425,"depth":1127,"text":2426,"children":4781},[4782,4783],{"id":2429,"depth":1134,"text":2430},{"id":2441,"depth":1134,"text":2442},{"id":2451,"depth":1127,"text":2452},{"id":3101,"depth":1127,"text":3102,"children":4786},[4787,4788,4789,4790],{"id":3105,"depth":1134,"text":3106},{"id":3138,"depth":1134,"text":3139},{"id":3289,"depth":1134,"text":3290},{"id":3392,"depth":1134,"text":3393},{"id":3663,"depth":1127,"text":3664,"children":4792},[4793,4794],{"id":3667,"depth":1134,"text":3668},{"id":3685,"depth":1134,"text":3686},{"id":3706,"depth":1127,"text":3707,"children":4796},[4797,4798,4799],{"id":3710,"depth":1134,"text":3711},{"id":3720,"depth":1134,"text":3721},{"id":3729,"depth":1134,"text":3730},{"id":3738,"depth":1127,"text":3739,"children":4801},[4802,4803,4804],{"id":3742,"depth":1134,"text":3743},{"id":4094,"depth":1134,"text":4095},{"id":4570,"depth":1134,"text":4571},"md",null,{},{"title":19,"description":1028},"Yt9SJH4cFx6dJcQtfqFiwRch1EIW7KZ4wcxTxNosTa8",[4811,4813],{"title":15,"path":16,"stem":17,"description":4812,"children":-1},"Django's design philosophy shapes every aspect of the framework, creating a consistent and predictable development experience. Understanding these principles will help you write better Django code and make architectural decisions that align with the framework's strengths.",{"title":23,"path":24,"stem":25,"description":4814,"children":-1},"Understanding Django's project structure is crucial for effective development. Django organizes code into projects and apps, each serving specific purposes in your web application architecture.",1772474895358]