[{"data":1,"prerenderedAt":2882},["ShallowReactive",2],{"navigation":3,"/asynchronous-django":1016,"/asynchronous-django-surround":2877},[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":703,"body":1018,"description":1028,"extension":2872,"links":2873,"meta":2874,"navigation":1217,"path":704,"seo":2875,"stem":705,"__hash__":2876},"docs/19.asynchronous-django/01.index.md",{"type":1019,"value":1020,"toc":2837},"minimark",[1021,1025,1029,1034,1037,1042,1065,1069,1072,1090,1094,1100,1119,1124,1141,1145,1149,1152,1264,1268,1276,1280,1283,1289,1294,1299,1304,1310,1314,1318,1557,1561,1731,1735,1862,1866,1869,1890,1894,1897,1936,1940,1944,2141,2145,2275,2279,2379,2383,2386,2411,2415,2418,2440,2444,2447,2659,2663,2666,2687,2691,2694,2714,2718,2721,2743,2747,2750,2767,2771,2774,2796,2800,2803,2823,2827,2830,2833],[1022,1023,703],"h1",{"id":1024},"asynchronous-django",[1026,1027,1028],"p",{},"Modern web applications demand high concurrency, real-time features, and efficient resource utilization. Django's asynchronous capabilities enable building applications that handle thousands of concurrent connections, provide real-time updates, and process background tasks efficiently. This comprehensive guide covers Django's async ecosystem, from ASGI and async views to WebSockets and background task processing.",[1030,1031,1033],"h2",{"id":1032},"the-async-revolution","The Async Revolution",[1026,1035,1036],{},"Traditional synchronous web applications handle one request at a time per thread, leading to resource inefficiency when dealing with I/O-bound operations like database queries, API calls, or file operations. Asynchronous programming allows applications to handle multiple operations concurrently, dramatically improving performance and scalability.",[1038,1039,1041],"h3",{"id":1040},"why-async-matters","Why Async Matters",[1026,1043,1044,1048,1049,1052,1053,1056,1057,1060,1061,1064],{},[1045,1046,1047],"strong",{},"Concurrency",": Handle thousands of simultaneous connections with minimal resource overhead\n",[1045,1050,1051],{},"Real-Time Features",": Enable live chat, notifications, collaborative editing, and real-time dashboards\n",[1045,1054,1055],{},"I/O Efficiency",": Maximize throughput for database queries, API calls, and external service integrations\n",[1045,1058,1059],{},"Resource Optimization",": Reduce server costs by handling more users with the same hardware\n",[1045,1062,1063],{},"Modern User Expectations",": Meet demands for instant updates and responsive interfaces",[1030,1066,1068],{"id":1067},"djangos-async-evolution","Django's Async Evolution",[1026,1070,1071],{},"Django's journey to async support represents a fundamental architectural shift:",[1026,1073,1074,1077,1078,1081,1082,1085,1086,1089],{},[1045,1075,1076],{},"Django 3.0",": Introduced ASGI support and basic async view capabilities\n",[1045,1079,1080],{},"Django 3.1",": Added async support for middleware and enhanced async views\n",[1045,1083,1084],{},"Django 4.0",": Improved async ORM capabilities and performance optimizations\n",[1045,1087,1088],{},"Django 4.1+",": Continued refinements and expanded async ecosystem integration",[1038,1091,1093],{"id":1092},"async-vs-sync-when-to-choose","Async vs Sync: When to Choose",[1026,1095,1096,1099],{},[1045,1097,1098],{},"Use Async When",":",[1101,1102,1103,1107,1110,1113,1116],"ul",{},[1104,1105,1106],"li",{},"Building real-time features (chat, notifications, live updates)",[1104,1108,1109],{},"Handling high-concurrency scenarios (APIs, webhooks)",[1104,1111,1112],{},"Integrating with external services extensively",[1104,1114,1115],{},"Processing I/O-heavy operations",[1104,1117,1118],{},"Building modern SPAs with WebSocket communication",[1026,1120,1121,1099],{},[1045,1122,1123],{},"Stick with Sync When",[1101,1125,1126,1129,1132,1135,1138],{},[1104,1127,1128],{},"Building traditional CRUD applications",[1104,1130,1131],{},"Working with CPU-intensive operations",[1104,1133,1134],{},"Using libraries without async support",[1104,1136,1137],{},"Maintaining existing synchronous codebases",[1104,1139,1140],{},"Team lacks async programming experience",[1030,1142,1144],{"id":1143},"django-async-architecture","Django Async Architecture",[1038,1146,1148],{"id":1147},"asgi-foundation","ASGI Foundation",[1026,1150,1151],{},"ASGI (Asynchronous Server Gateway Interface) is Django's async equivalent to WSGI:",[1153,1154,1159],"pre",{"className":1155,"code":1156,"language":1157,"meta":1158,"style":1158},"language-python shiki shiki-themes material-theme-lighter vitesse-light vitesse-dark","# Traditional WSGI\ndef application(environ, start_response):\n    # Synchronous request handling\n    pass\n\n# Modern ASGI\nasync def application(scope, receive, send):\n    # Asynchronous request handling\n    pass\n","python","",[1160,1161,1162,1171,1199,1205,1212,1219,1225,1253,1259],"code",{"__ignoreMap":1158},[1163,1164,1167],"span",{"class":1165,"line":1166},"line",1,[1163,1168,1170],{"class":1169},"s9Tkl","# Traditional WSGI\n",[1163,1172,1174,1178,1182,1186,1190,1193,1196],{"class":1165,"line":1173},2,[1163,1175,1177],{"class":1176},"s5Kfy","def",[1163,1179,1181],{"class":1180},"sljsM"," application",[1163,1183,1185],{"class":1184},"soVBu","(",[1163,1187,1189],{"class":1188},"sCyAa","environ",[1163,1191,1192],{"class":1184},",",[1163,1194,1195],{"class":1188}," start_response",[1163,1197,1198],{"class":1184},"):\n",[1163,1200,1202],{"class":1165,"line":1201},3,[1163,1203,1204],{"class":1169},"    # Synchronous request handling\n",[1163,1206,1208],{"class":1165,"line":1207},4,[1163,1209,1211],{"class":1210},"siDh9","    pass\n",[1163,1213,1215],{"class":1165,"line":1214},5,[1163,1216,1218],{"emptyLinePlaceholder":1217},true,"\n",[1163,1220,1222],{"class":1165,"line":1221},6,[1163,1223,1224],{"class":1169},"# Modern ASGI\n",[1163,1226,1228,1231,1234,1236,1238,1241,1243,1246,1248,1251],{"class":1165,"line":1227},7,[1163,1229,1230],{"class":1176},"async",[1163,1232,1233],{"class":1176}," def",[1163,1235,1181],{"class":1180},[1163,1237,1185],{"class":1184},[1163,1239,1240],{"class":1188},"scope",[1163,1242,1192],{"class":1184},[1163,1244,1245],{"class":1188}," receive",[1163,1247,1192],{"class":1184},[1163,1249,1250],{"class":1188}," send",[1163,1252,1198],{"class":1184},[1163,1254,1256],{"class":1165,"line":1255},8,[1163,1257,1258],{"class":1169},"    # Asynchronous request handling\n",[1163,1260,1262],{"class":1165,"line":1261},9,[1163,1263,1211],{"class":1210},[1038,1265,1267],{"id":1266},"async-components-stack","Async Components Stack",[1153,1269,1274],{"className":1270,"code":1272,"language":1273},[1271],"language-text","┌─────────────────────────────────────┐\n│           Frontend (React/Vue)       │\n└─────────────────────────────────────┘\n                    ↓ WebSocket/HTTP\n┌─────────────────────────────────────┐\n│         ASGI Server (Uvicorn)       │\n└─────────────────────────────────────┘\n                    ↓\n┌─────────────────────────────────────┐\n│        Django Async Views          │\n└─────────────────────────────────────┘\n                    ↓\n┌─────────────────────────────────────┐\n│      Django Channels (WebSockets)   │\n└─────────────────────────────────────┘\n                    ↓\n┌─────────────────────────────────────┐\n│       Background Tasks (Celery)     │\n└─────────────────────────────────────┘\n                    ↓\n┌─────────────────────────────────────┐\n│      Database (Async Drivers)       │\n└─────────────────────────────────────┘\n","text",[1160,1275,1272],{"__ignoreMap":1158},[1030,1277,1279],{"id":1278},"what-youll-learn","What You'll Learn",[1026,1281,1282],{},"This comprehensive guide covers Django's complete async ecosystem:",[1026,1284,1285,1288],{},[1045,1286,1287],{},"ASGI Fundamentals",": Understanding ASGI architecture, server configuration, and deployment patterns for async Django applications.",[1026,1290,1291,1293],{},[1045,1292,713],{},": Building high-performance async views, handling concurrent requests, and integrating with async libraries and external services.",[1026,1295,1296,1298],{},[1045,1297,717],{},": Current state of Django's async ORM capabilities, limitations, workarounds, and best practices for database operations in async contexts.",[1026,1300,1301,1303],{},[1045,1302,721],{},": Implementing real-time features using Django Channels, including chat systems, live notifications, and collaborative applications.",[1026,1305,1306,1309],{},[1045,1307,1308],{},"Background Tasks",": Processing long-running operations with Celery and RQ, including task queues, scheduling, and monitoring in async environments.",[1030,1311,1313],{"id":1312},"real-time-application-patterns","Real-Time Application Patterns",[1038,1315,1317],{"id":1316},"live-chat-system","Live Chat System",[1153,1319,1321],{"className":1155,"code":1320,"language":1157,"meta":1158,"style":1158},"# WebSocket consumer for real-time chat\nclass ChatConsumer(AsyncWebsocketConsumer):\n    async def connect(self):\n        await self.channel_layer.group_add(\"chat\", self.channel_name)\n        await self.accept()\n    \n    async def receive(self, text_data):\n        message = json.loads(text_data)\n        await self.channel_layer.group_send(\"chat\", {\n            'type': 'chat_message',\n            'message': message['message']\n        })\n",[1160,1322,1323,1328,1345,1363,1409,1423,1429,1448,1471,1499,1524,1551],{"__ignoreMap":1158},[1163,1324,1325],{"class":1165,"line":1166},[1163,1326,1327],{"class":1169},"# WebSocket consumer for real-time chat\n",[1163,1329,1330,1333,1337,1339,1343],{"class":1165,"line":1173},[1163,1331,1332],{"class":1176},"class",[1163,1334,1336],{"class":1335},"sD-vU"," ChatConsumer",[1163,1338,1185],{"class":1184},[1163,1340,1342],{"class":1341},"sYn-s","AsyncWebsocketConsumer",[1163,1344,1198],{"class":1184},[1163,1346,1347,1350,1352,1355,1357,1361],{"class":1165,"line":1201},[1163,1348,1349],{"class":1176},"    async",[1163,1351,1233],{"class":1176},[1163,1353,1354],{"class":1180}," connect",[1163,1356,1185],{"class":1184},[1163,1358,1360],{"class":1359},"sRjD_","self",[1163,1362,1198],{"class":1184},[1163,1364,1365,1368,1372,1375,1379,1381,1385,1387,1391,1395,1397,1399,1401,1403,1406],{"class":1165,"line":1207},[1163,1366,1367],{"class":1210},"        await",[1163,1369,1371],{"class":1370},"se3Ec"," self",[1163,1373,1374],{"class":1184},".",[1163,1376,1378],{"class":1377},"sBPpx","channel_layer",[1163,1380,1374],{"class":1184},[1163,1382,1384],{"class":1383},"siWMO","group_add",[1163,1386,1185],{"class":1184},[1163,1388,1390],{"class":1389},"sbYkP","\"",[1163,1392,1394],{"class":1393},"sTbE_","chat",[1163,1396,1390],{"class":1389},[1163,1398,1192],{"class":1184},[1163,1400,1371],{"class":1370},[1163,1402,1374],{"class":1184},[1163,1404,1405],{"class":1377},"channel_name",[1163,1407,1408],{"class":1184},")\n",[1163,1410,1411,1413,1415,1417,1420],{"class":1165,"line":1214},[1163,1412,1367],{"class":1210},[1163,1414,1371],{"class":1370},[1163,1416,1374],{"class":1184},[1163,1418,1419],{"class":1383},"accept",[1163,1421,1422],{"class":1184},"()\n",[1163,1424,1425],{"class":1165,"line":1221},[1163,1426,1428],{"class":1427},"sftqT","    \n",[1163,1430,1431,1433,1435,1437,1439,1441,1443,1446],{"class":1165,"line":1227},[1163,1432,1349],{"class":1176},[1163,1434,1233],{"class":1176},[1163,1436,1245],{"class":1180},[1163,1438,1185],{"class":1184},[1163,1440,1360],{"class":1359},[1163,1442,1192],{"class":1184},[1163,1444,1445],{"class":1188}," text_data",[1163,1447,1198],{"class":1184},[1163,1449,1450,1453,1456,1459,1461,1464,1466,1469],{"class":1165,"line":1255},[1163,1451,1452],{"class":1427},"        message ",[1163,1454,1455],{"class":1184},"=",[1163,1457,1458],{"class":1427}," json",[1163,1460,1374],{"class":1184},[1163,1462,1463],{"class":1383},"loads",[1163,1465,1185],{"class":1184},[1163,1467,1468],{"class":1383},"text_data",[1163,1470,1408],{"class":1184},[1163,1472,1473,1475,1477,1479,1481,1483,1486,1488,1490,1492,1494,1496],{"class":1165,"line":1261},[1163,1474,1367],{"class":1210},[1163,1476,1371],{"class":1370},[1163,1478,1374],{"class":1184},[1163,1480,1378],{"class":1377},[1163,1482,1374],{"class":1184},[1163,1484,1485],{"class":1383},"group_send",[1163,1487,1185],{"class":1184},[1163,1489,1390],{"class":1389},[1163,1491,1394],{"class":1393},[1163,1493,1390],{"class":1389},[1163,1495,1192],{"class":1184},[1163,1497,1498],{"class":1184}," {\n",[1163,1500,1502,1505,1508,1511,1513,1516,1519,1521],{"class":1165,"line":1501},10,[1163,1503,1504],{"class":1389},"            '",[1163,1506,1507],{"class":1393},"type",[1163,1509,1510],{"class":1389},"'",[1163,1512,1099],{"class":1184},[1163,1514,1515],{"class":1389}," '",[1163,1517,1518],{"class":1393},"chat_message",[1163,1520,1510],{"class":1389},[1163,1522,1523],{"class":1184},",\n",[1163,1525,1527,1529,1532,1534,1536,1539,1542,1544,1546,1548],{"class":1165,"line":1526},11,[1163,1528,1504],{"class":1389},[1163,1530,1531],{"class":1393},"message",[1163,1533,1510],{"class":1389},[1163,1535,1099],{"class":1184},[1163,1537,1538],{"class":1383}," message",[1163,1540,1541],{"class":1184},"[",[1163,1543,1510],{"class":1389},[1163,1545,1531],{"class":1393},[1163,1547,1510],{"class":1389},[1163,1549,1550],{"class":1184},"]\n",[1163,1552,1554],{"class":1165,"line":1553},12,[1163,1555,1556],{"class":1184},"        })\n",[1038,1558,1560],{"id":1559},"real-time-notifications","Real-Time Notifications",[1153,1562,1564],{"className":1155,"code":1563,"language":1157,"meta":1158,"style":1158},"# Async view with real-time updates\nasync def notification_stream(request):\n    async def event_stream():\n        while True:\n            notifications = await get_user_notifications(request.user)\n            yield f\"data: {json.dumps(notifications)}\\n\\n\"\n            await asyncio.sleep(1)\n    \n    return StreamingHttpResponse(event_stream(), content_type='text/event-stream')\n",[1160,1565,1566,1571,1587,1599,1611,1635,1675,1696,1700],{"__ignoreMap":1158},[1163,1567,1568],{"class":1165,"line":1166},[1163,1569,1570],{"class":1169},"# Async view with real-time updates\n",[1163,1572,1573,1575,1577,1580,1582,1585],{"class":1165,"line":1173},[1163,1574,1230],{"class":1176},[1163,1576,1233],{"class":1176},[1163,1578,1579],{"class":1180}," notification_stream",[1163,1581,1185],{"class":1184},[1163,1583,1584],{"class":1188},"request",[1163,1586,1198],{"class":1184},[1163,1588,1589,1591,1593,1596],{"class":1165,"line":1201},[1163,1590,1349],{"class":1176},[1163,1592,1233],{"class":1176},[1163,1594,1595],{"class":1180}," event_stream",[1163,1597,1598],{"class":1184},"():\n",[1163,1600,1601,1604,1608],{"class":1165,"line":1207},[1163,1602,1603],{"class":1210},"        while",[1163,1605,1607],{"class":1606},"s8XtY"," True",[1163,1609,1610],{"class":1184},":\n",[1163,1612,1613,1616,1618,1621,1624,1626,1628,1630,1633],{"class":1165,"line":1214},[1163,1614,1615],{"class":1427},"            notifications ",[1163,1617,1455],{"class":1184},[1163,1619,1620],{"class":1210}," await",[1163,1622,1623],{"class":1383}," get_user_notifications",[1163,1625,1185],{"class":1184},[1163,1627,1584],{"class":1383},[1163,1629,1374],{"class":1184},[1163,1631,1632],{"class":1377},"user",[1163,1634,1408],{"class":1184},[1163,1636,1637,1640,1643,1646,1650,1653,1655,1658,1660,1663,1666,1669,1672],{"class":1165,"line":1221},[1163,1638,1639],{"class":1210},"            yield",[1163,1641,1642],{"class":1176}," f",[1163,1644,1645],{"class":1393},"\"data: ",[1163,1647,1649],{"class":1648},"s3h35","{",[1163,1651,1652],{"class":1427},"json",[1163,1654,1374],{"class":1184},[1163,1656,1657],{"class":1383},"dumps",[1163,1659,1185],{"class":1184},[1163,1661,1662],{"class":1383},"notifications",[1163,1664,1665],{"class":1184},")",[1163,1667,1668],{"class":1648},"}",[1163,1670,1671],{"class":1370},"\\n\\n",[1163,1673,1674],{"class":1393},"\"\n",[1163,1676,1677,1680,1683,1685,1688,1690,1694],{"class":1165,"line":1227},[1163,1678,1679],{"class":1210},"            await",[1163,1681,1682],{"class":1427}," asyncio",[1163,1684,1374],{"class":1184},[1163,1686,1687],{"class":1383},"sleep",[1163,1689,1185],{"class":1184},[1163,1691,1693],{"class":1692},"s7CZa","1",[1163,1695,1408],{"class":1184},[1163,1697,1698],{"class":1165,"line":1255},[1163,1699,1428],{"class":1427},[1163,1701,1702,1705,1708,1710,1713,1716,1720,1722,1724,1727,1729],{"class":1165,"line":1261},[1163,1703,1704],{"class":1210},"    return",[1163,1706,1707],{"class":1383}," StreamingHttpResponse",[1163,1709,1185],{"class":1184},[1163,1711,1712],{"class":1383},"event_stream",[1163,1714,1715],{"class":1184},"(),",[1163,1717,1719],{"class":1718},"sqOPj"," content_type",[1163,1721,1455],{"class":1184},[1163,1723,1510],{"class":1389},[1163,1725,1726],{"class":1393},"text/event-stream",[1163,1728,1510],{"class":1389},[1163,1730,1408],{"class":1184},[1038,1732,1734],{"id":1733},"background-task-integration","Background Task Integration",[1153,1736,1738],{"className":1155,"code":1737,"language":1157,"meta":1158,"style":1158},"# Async view triggering background tasks\nasync def process_upload(request):\n    file_data = await request.aread()\n    \n    # Trigger async background processing\n    task = process_file_async.delay(file_data)\n    \n    return JsonResponse({'task_id': task.id, 'status': 'processing'})\n",[1160,1739,1740,1745,1760,1779,1783,1788,1810,1814],{"__ignoreMap":1158},[1163,1741,1742],{"class":1165,"line":1166},[1163,1743,1744],{"class":1169},"# Async view triggering background tasks\n",[1163,1746,1747,1749,1751,1754,1756,1758],{"class":1165,"line":1173},[1163,1748,1230],{"class":1176},[1163,1750,1233],{"class":1176},[1163,1752,1753],{"class":1180}," process_upload",[1163,1755,1185],{"class":1184},[1163,1757,1584],{"class":1188},[1163,1759,1198],{"class":1184},[1163,1761,1762,1765,1767,1769,1772,1774,1777],{"class":1165,"line":1201},[1163,1763,1764],{"class":1427},"    file_data ",[1163,1766,1455],{"class":1184},[1163,1768,1620],{"class":1210},[1163,1770,1771],{"class":1427}," request",[1163,1773,1374],{"class":1184},[1163,1775,1776],{"class":1383},"aread",[1163,1778,1422],{"class":1184},[1163,1780,1781],{"class":1165,"line":1207},[1163,1782,1428],{"class":1427},[1163,1784,1785],{"class":1165,"line":1214},[1163,1786,1787],{"class":1169},"    # Trigger async background processing\n",[1163,1789,1790,1793,1795,1798,1800,1803,1805,1808],{"class":1165,"line":1221},[1163,1791,1792],{"class":1427},"    task ",[1163,1794,1455],{"class":1184},[1163,1796,1797],{"class":1427}," process_file_async",[1163,1799,1374],{"class":1184},[1163,1801,1802],{"class":1383},"delay",[1163,1804,1185],{"class":1184},[1163,1806,1807],{"class":1383},"file_data",[1163,1809,1408],{"class":1184},[1163,1811,1812],{"class":1165,"line":1227},[1163,1813,1428],{"class":1427},[1163,1815,1816,1818,1821,1824,1826,1829,1831,1833,1836,1838,1841,1843,1845,1848,1850,1852,1854,1857,1859],{"class":1165,"line":1255},[1163,1817,1704],{"class":1210},[1163,1819,1820],{"class":1383}," JsonResponse",[1163,1822,1823],{"class":1184},"({",[1163,1825,1510],{"class":1389},[1163,1827,1828],{"class":1393},"task_id",[1163,1830,1510],{"class":1389},[1163,1832,1099],{"class":1184},[1163,1834,1835],{"class":1383}," task",[1163,1837,1374],{"class":1184},[1163,1839,1840],{"class":1377},"id",[1163,1842,1192],{"class":1184},[1163,1844,1515],{"class":1389},[1163,1846,1847],{"class":1393},"status",[1163,1849,1510],{"class":1389},[1163,1851,1099],{"class":1184},[1163,1853,1515],{"class":1389},[1163,1855,1856],{"class":1393},"processing",[1163,1858,1510],{"class":1389},[1163,1860,1861],{"class":1184},"})\n",[1030,1863,1865],{"id":1864},"performance-benefits","Performance Benefits",[1026,1867,1868],{},"Async Django applications can achieve dramatic performance improvements:",[1026,1870,1871,1873,1874,1877,1878,1881,1882,1885,1886,1889],{},[1045,1872,1047],{},": Handle 10,000+ concurrent WebSocket connections on a single server\n",[1045,1875,1876],{},"Throughput",": Process 5-10x more HTTP requests per second for I/O-bound operations\n",[1045,1879,1880],{},"Resource Efficiency",": Reduce memory usage by 60-80% compared to traditional threading\n",[1045,1883,1884],{},"Response Times",": Achieve sub-millisecond response times for cached or simple operations\n",[1045,1887,1888],{},"Scalability",": Scale to millions of users with proper async architecture",[1030,1891,1893],{"id":1892},"development-workflow","Development Workflow",[1026,1895,1896],{},"Building async Django applications requires understanding new patterns:",[1898,1899,1900,1906,1912,1918,1924,1930],"ol",{},[1104,1901,1902,1905],{},[1045,1903,1904],{},"Architecture Planning",": Design for async from the beginning",[1104,1907,1908,1911],{},[1045,1909,1910],{},"Async/Await Patterns",": Master Python's async/await syntax",[1104,1913,1914,1917],{},[1045,1915,1916],{},"Concurrency Management",": Handle shared state and race conditions",[1104,1919,1920,1923],{},[1045,1921,1922],{},"Testing Strategies",": Test async code with proper async test frameworks",[1104,1925,1926,1929],{},[1045,1927,1928],{},"Deployment Considerations",": Configure ASGI servers and async-capable infrastructure",[1104,1931,1932,1935],{},[1045,1933,1934],{},"Monitoring",": Track async-specific metrics and performance indicators",[1030,1937,1939],{"id":1938},"common-async-patterns","Common Async Patterns",[1038,1941,1943],{"id":1942},"concurrent-api-calls","Concurrent API Calls",[1153,1945,1947],{"className":1155,"code":1946,"language":1157,"meta":1158,"style":1158},"async def fetch_user_data(user_id):\n    async with aiohttp.ClientSession() as session:\n        tasks = [\n            fetch_profile(session, user_id),\n            fetch_posts(session, user_id),\n            fetch_followers(session, user_id)\n        ]\n        profile, posts, followers = await asyncio.gather(*tasks)\n        return {'profile': profile, 'posts': posts, 'followers': followers}\n",[1160,1948,1949,1965,1991,2001,2019,2034,2049,2054,2091],{"__ignoreMap":1158},[1163,1950,1951,1953,1955,1958,1960,1963],{"class":1165,"line":1166},[1163,1952,1230],{"class":1176},[1163,1954,1233],{"class":1176},[1163,1956,1957],{"class":1180}," fetch_user_data",[1163,1959,1185],{"class":1184},[1163,1961,1962],{"class":1188},"user_id",[1163,1964,1198],{"class":1184},[1163,1966,1967,1969,1972,1975,1977,1980,1983,1986,1989],{"class":1165,"line":1173},[1163,1968,1349],{"class":1210},[1163,1970,1971],{"class":1210}," with",[1163,1973,1974],{"class":1427}," aiohttp",[1163,1976,1374],{"class":1184},[1163,1978,1979],{"class":1383},"ClientSession",[1163,1981,1982],{"class":1184},"()",[1163,1984,1985],{"class":1210}," as",[1163,1987,1988],{"class":1427}," session",[1163,1990,1610],{"class":1184},[1163,1992,1993,1996,1998],{"class":1165,"line":1201},[1163,1994,1995],{"class":1427},"        tasks ",[1163,1997,1455],{"class":1184},[1163,1999,2000],{"class":1184}," [\n",[1163,2002,2003,2006,2008,2011,2013,2016],{"class":1165,"line":1207},[1163,2004,2005],{"class":1383},"            fetch_profile",[1163,2007,1185],{"class":1184},[1163,2009,2010],{"class":1383},"session",[1163,2012,1192],{"class":1184},[1163,2014,2015],{"class":1383}," user_id",[1163,2017,2018],{"class":1184},"),\n",[1163,2020,2021,2024,2026,2028,2030,2032],{"class":1165,"line":1214},[1163,2022,2023],{"class":1383},"            fetch_posts",[1163,2025,1185],{"class":1184},[1163,2027,2010],{"class":1383},[1163,2029,1192],{"class":1184},[1163,2031,2015],{"class":1383},[1163,2033,2018],{"class":1184},[1163,2035,2036,2039,2041,2043,2045,2047],{"class":1165,"line":1221},[1163,2037,2038],{"class":1383},"            fetch_followers",[1163,2040,1185],{"class":1184},[1163,2042,2010],{"class":1383},[1163,2044,1192],{"class":1184},[1163,2046,2015],{"class":1383},[1163,2048,1408],{"class":1184},[1163,2050,2051],{"class":1165,"line":1227},[1163,2052,2053],{"class":1184},"        ]\n",[1163,2055,2056,2059,2061,2064,2066,2069,2071,2073,2075,2077,2080,2082,2086,2089],{"class":1165,"line":1255},[1163,2057,2058],{"class":1427},"        profile",[1163,2060,1192],{"class":1184},[1163,2062,2063],{"class":1427}," posts",[1163,2065,1192],{"class":1184},[1163,2067,2068],{"class":1427}," followers ",[1163,2070,1455],{"class":1184},[1163,2072,1620],{"class":1210},[1163,2074,1682],{"class":1427},[1163,2076,1374],{"class":1184},[1163,2078,2079],{"class":1383},"gather",[1163,2081,1185],{"class":1184},[1163,2083,2085],{"class":2084},"sVsLi","*",[1163,2087,2088],{"class":1383},"tasks",[1163,2090,1408],{"class":1184},[1163,2092,2093,2096,2099,2101,2104,2106,2108,2111,2113,2115,2118,2120,2122,2124,2126,2128,2131,2133,2135,2138],{"class":1165,"line":1261},[1163,2094,2095],{"class":1210},"        return",[1163,2097,2098],{"class":1184}," {",[1163,2100,1510],{"class":1389},[1163,2102,2103],{"class":1393},"profile",[1163,2105,1510],{"class":1389},[1163,2107,1099],{"class":1184},[1163,2109,2110],{"class":1427}," profile",[1163,2112,1192],{"class":1184},[1163,2114,1515],{"class":1389},[1163,2116,2117],{"class":1393},"posts",[1163,2119,1510],{"class":1389},[1163,2121,1099],{"class":1184},[1163,2123,2063],{"class":1427},[1163,2125,1192],{"class":1184},[1163,2127,1515],{"class":1389},[1163,2129,2130],{"class":1393},"followers",[1163,2132,1510],{"class":1389},[1163,2134,1099],{"class":1184},[1163,2136,2137],{"class":1427}," followers",[1163,2139,2140],{"class":1184},"}\n",[1038,2142,2144],{"id":2143},"database-connection-pooling","Database Connection Pooling",[1153,2146,2148],{"className":1155,"code":2147,"language":1157,"meta":1158,"style":1158},"# Async database configuration\nDATABASES = {\n    'default': {\n        'ENGINE': 'django.db.backends.postgresql',\n        'OPTIONS': {\n            'MAX_CONNS': 20,\n            'MIN_CONNS': 5,\n        },\n        'CONN_MAX_AGE': 600,\n    }\n}\n",[1160,2149,2150,2155,2165,2179,2200,2213,2229,2245,2250,2266,2271],{"__ignoreMap":1158},[1163,2151,2152],{"class":1165,"line":1166},[1163,2153,2154],{"class":1169},"# Async database configuration\n",[1163,2156,2157,2160,2163],{"class":1165,"line":1173},[1163,2158,2159],{"class":1370},"DATABASES",[1163,2161,2162],{"class":1184}," =",[1163,2164,1498],{"class":1184},[1163,2166,2167,2170,2173,2175,2177],{"class":1165,"line":1201},[1163,2168,2169],{"class":1389},"    '",[1163,2171,2172],{"class":1393},"default",[1163,2174,1510],{"class":1389},[1163,2176,1099],{"class":1184},[1163,2178,1498],{"class":1184},[1163,2180,2181,2184,2187,2189,2191,2193,2196,2198],{"class":1165,"line":1207},[1163,2182,2183],{"class":1389},"        '",[1163,2185,2186],{"class":1393},"ENGINE",[1163,2188,1510],{"class":1389},[1163,2190,1099],{"class":1184},[1163,2192,1515],{"class":1389},[1163,2194,2195],{"class":1393},"django.db.backends.postgresql",[1163,2197,1510],{"class":1389},[1163,2199,1523],{"class":1184},[1163,2201,2202,2204,2207,2209,2211],{"class":1165,"line":1214},[1163,2203,2183],{"class":1389},[1163,2205,2206],{"class":1393},"OPTIONS",[1163,2208,1510],{"class":1389},[1163,2210,1099],{"class":1184},[1163,2212,1498],{"class":1184},[1163,2214,2215,2217,2220,2222,2224,2227],{"class":1165,"line":1221},[1163,2216,1504],{"class":1389},[1163,2218,2219],{"class":1393},"MAX_CONNS",[1163,2221,1510],{"class":1389},[1163,2223,1099],{"class":1184},[1163,2225,2226],{"class":1692}," 20",[1163,2228,1523],{"class":1184},[1163,2230,2231,2233,2236,2238,2240,2243],{"class":1165,"line":1227},[1163,2232,1504],{"class":1389},[1163,2234,2235],{"class":1393},"MIN_CONNS",[1163,2237,1510],{"class":1389},[1163,2239,1099],{"class":1184},[1163,2241,2242],{"class":1692}," 5",[1163,2244,1523],{"class":1184},[1163,2246,2247],{"class":1165,"line":1255},[1163,2248,2249],{"class":1184},"        },\n",[1163,2251,2252,2254,2257,2259,2261,2264],{"class":1165,"line":1261},[1163,2253,2183],{"class":1389},[1163,2255,2256],{"class":1393},"CONN_MAX_AGE",[1163,2258,1510],{"class":1389},[1163,2260,1099],{"class":1184},[1163,2262,2263],{"class":1692}," 600",[1163,2265,1523],{"class":1184},[1163,2267,2268],{"class":1165,"line":1501},[1163,2269,2270],{"class":1184},"    }\n",[1163,2272,2273],{"class":1165,"line":1526},[1163,2274,2140],{"class":1184},[1038,2276,2278],{"id":2277},"websocket-broadcasting","WebSocket Broadcasting",[1153,2280,2282],{"className":1155,"code":2281,"language":1157,"meta":1158,"style":1158},"# Broadcast to multiple channels\nasync def broadcast_update(data):\n    channel_layer = get_channel_layer()\n    await channel_layer.group_send(\"live_updates\", {\n        'type': 'update_message',\n        'data': data\n    })\n",[1160,2283,2284,2289,2305,2317,2342,2361,2374],{"__ignoreMap":1158},[1163,2285,2286],{"class":1165,"line":1166},[1163,2287,2288],{"class":1169},"# Broadcast to multiple channels\n",[1163,2290,2291,2293,2295,2298,2300,2303],{"class":1165,"line":1173},[1163,2292,1230],{"class":1176},[1163,2294,1233],{"class":1176},[1163,2296,2297],{"class":1180}," broadcast_update",[1163,2299,1185],{"class":1184},[1163,2301,2302],{"class":1188},"data",[1163,2304,1198],{"class":1184},[1163,2306,2307,2310,2312,2315],{"class":1165,"line":1201},[1163,2308,2309],{"class":1427},"    channel_layer ",[1163,2311,1455],{"class":1184},[1163,2313,2314],{"class":1383}," get_channel_layer",[1163,2316,1422],{"class":1184},[1163,2318,2319,2322,2325,2327,2329,2331,2333,2336,2338,2340],{"class":1165,"line":1207},[1163,2320,2321],{"class":1210},"    await",[1163,2323,2324],{"class":1427}," channel_layer",[1163,2326,1374],{"class":1184},[1163,2328,1485],{"class":1383},[1163,2330,1185],{"class":1184},[1163,2332,1390],{"class":1389},[1163,2334,2335],{"class":1393},"live_updates",[1163,2337,1390],{"class":1389},[1163,2339,1192],{"class":1184},[1163,2341,1498],{"class":1184},[1163,2343,2344,2346,2348,2350,2352,2354,2357,2359],{"class":1165,"line":1214},[1163,2345,2183],{"class":1389},[1163,2347,1507],{"class":1393},[1163,2349,1510],{"class":1389},[1163,2351,1099],{"class":1184},[1163,2353,1515],{"class":1389},[1163,2355,2356],{"class":1393},"update_message",[1163,2358,1510],{"class":1389},[1163,2360,1523],{"class":1184},[1163,2362,2363,2365,2367,2369,2371],{"class":1165,"line":1221},[1163,2364,2183],{"class":1389},[1163,2366,2302],{"class":1393},[1163,2368,1510],{"class":1389},[1163,2370,1099],{"class":1184},[1163,2372,2373],{"class":1383}," data\n",[1163,2375,2376],{"class":1165,"line":1227},[1163,2377,2378],{"class":1184},"    })\n",[1030,2380,2382],{"id":2381},"integration-ecosystem","Integration Ecosystem",[1026,2384,2385],{},"Django's async capabilities integrate with a rich ecosystem:",[1026,2387,2388,2391,2392,2395,2396,2399,2400,2403,2404,2407,2408,2410],{},[1045,2389,2390],{},"ASGI Servers",": Uvicorn, Hypercorn, Daphne for production deployment\n",[1045,2393,2394],{},"WebSocket Libraries",": Django Channels for real-time communication\n",[1045,2397,2398],{},"HTTP Clients",": aiohttp, httpx for async external API calls\n",[1045,2401,2402],{},"Database Drivers",": asyncpg, aiomysql for async database operations\n",[1045,2405,2406],{},"Task Queues",": Celery, RQ, Dramatiq for background processing\n",[1045,2409,1934],{},": Sentry, DataDog, Prometheus for async application monitoring",[1030,2412,2414],{"id":2413},"security-considerations","Security Considerations",[1026,2416,2417],{},"Async applications introduce unique security challenges:",[1026,2419,2420,2423,2424,2427,2428,2431,2432,2435,2436,2439],{},[1045,2421,2422],{},"Race Conditions",": Prevent concurrent access to shared resources\n",[1045,2425,2426],{},"WebSocket Security",": Implement proper authentication and authorization\n",[1045,2429,2430],{},"Resource Exhaustion",": Protect against async-specific DoS attacks\n",[1045,2433,2434],{},"Data Consistency",": Ensure data integrity in concurrent operations\n",[1045,2437,2438],{},"Connection Management",": Properly handle WebSocket connection lifecycles",[1030,2441,2443],{"id":2442},"testing-async-code","Testing Async Code",[1026,2445,2446],{},"Async code requires specialized testing approaches:",[1153,2448,2450],{"className":1155,"code":2449,"language":1157,"meta":1158,"style":1158},"import pytest\nfrom django.test import AsyncClient\n\n@pytest.mark.asyncio\nasync def test_async_view():\n    client = AsyncClient()\n    response = await client.get('/async-endpoint/')\n    assert response.status_code == 200\n\n@pytest.mark.asyncio\nasync def test_websocket_consumer():\n    communicator = WebsocketCommunicator(ChatConsumer, \"/ws/chat/\")\n    connected, subprotocol = await communicator.connect()\n    assert connected\n",[1160,2451,2452,2460,2478,2482,2500,2511,2523,2551,2570,2574,2588,2599,2626,2651],{"__ignoreMap":1158},[1163,2453,2454,2457],{"class":1165,"line":1166},[1163,2455,2456],{"class":1210},"import",[1163,2458,2459],{"class":1427}," pytest\n",[1163,2461,2462,2465,2468,2470,2473,2475],{"class":1165,"line":1173},[1163,2463,2464],{"class":1210},"from",[1163,2466,2467],{"class":1427}," django",[1163,2469,1374],{"class":1184},[1163,2471,2472],{"class":1427},"test ",[1163,2474,2456],{"class":1210},[1163,2476,2477],{"class":1427}," AsyncClient\n",[1163,2479,2480],{"class":1165,"line":1201},[1163,2481,1218],{"emptyLinePlaceholder":1217},[1163,2483,2484,2487,2490,2492,2495,2497],{"class":1165,"line":1207},[1163,2485,2486],{"class":1184},"@",[1163,2488,2489],{"class":1180},"pytest",[1163,2491,1374],{"class":1184},[1163,2493,2494],{"class":1180},"mark",[1163,2496,1374],{"class":1184},[1163,2498,2499],{"class":1180},"asyncio\n",[1163,2501,2502,2504,2506,2509],{"class":1165,"line":1214},[1163,2503,1230],{"class":1176},[1163,2505,1233],{"class":1176},[1163,2507,2508],{"class":1180}," test_async_view",[1163,2510,1598],{"class":1184},[1163,2512,2513,2516,2518,2521],{"class":1165,"line":1221},[1163,2514,2515],{"class":1427},"    client ",[1163,2517,1455],{"class":1184},[1163,2519,2520],{"class":1383}," AsyncClient",[1163,2522,1422],{"class":1184},[1163,2524,2525,2528,2530,2532,2535,2537,2540,2542,2544,2547,2549],{"class":1165,"line":1227},[1163,2526,2527],{"class":1427},"    response ",[1163,2529,1455],{"class":1184},[1163,2531,1620],{"class":1210},[1163,2533,2534],{"class":1427}," client",[1163,2536,1374],{"class":1184},[1163,2538,2539],{"class":1383},"get",[1163,2541,1185],{"class":1184},[1163,2543,1510],{"class":1389},[1163,2545,2546],{"class":1393},"/async-endpoint/",[1163,2548,1510],{"class":1389},[1163,2550,1408],{"class":1184},[1163,2552,2553,2556,2559,2561,2564,2567],{"class":1165,"line":1255},[1163,2554,2555],{"class":1210},"    assert",[1163,2557,2558],{"class":1427}," response",[1163,2560,1374],{"class":1184},[1163,2562,2563],{"class":1377},"status_code",[1163,2565,2566],{"class":2084}," ==",[1163,2568,2569],{"class":1692}," 200\n",[1163,2571,2572],{"class":1165,"line":1261},[1163,2573,1218],{"emptyLinePlaceholder":1217},[1163,2575,2576,2578,2580,2582,2584,2586],{"class":1165,"line":1501},[1163,2577,2486],{"class":1184},[1163,2579,2489],{"class":1180},[1163,2581,1374],{"class":1184},[1163,2583,2494],{"class":1180},[1163,2585,1374],{"class":1184},[1163,2587,2499],{"class":1180},[1163,2589,2590,2592,2594,2597],{"class":1165,"line":1526},[1163,2591,1230],{"class":1176},[1163,2593,1233],{"class":1176},[1163,2595,2596],{"class":1180}," test_websocket_consumer",[1163,2598,1598],{"class":1184},[1163,2600,2601,2604,2606,2609,2611,2614,2616,2619,2622,2624],{"class":1165,"line":1553},[1163,2602,2603],{"class":1427},"    communicator ",[1163,2605,1455],{"class":1184},[1163,2607,2608],{"class":1383}," WebsocketCommunicator",[1163,2610,1185],{"class":1184},[1163,2612,2613],{"class":1383},"ChatConsumer",[1163,2615,1192],{"class":1184},[1163,2617,2618],{"class":1389}," \"",[1163,2620,2621],{"class":1393},"/ws/chat/",[1163,2623,1390],{"class":1389},[1163,2625,1408],{"class":1184},[1163,2627,2629,2632,2634,2637,2639,2641,2644,2646,2649],{"class":1165,"line":2628},13,[1163,2630,2631],{"class":1427},"    connected",[1163,2633,1192],{"class":1184},[1163,2635,2636],{"class":1427}," subprotocol ",[1163,2638,1455],{"class":1184},[1163,2640,1620],{"class":1210},[1163,2642,2643],{"class":1427}," communicator",[1163,2645,1374],{"class":1184},[1163,2647,2648],{"class":1383},"connect",[1163,2650,1422],{"class":1184},[1163,2652,2654,2656],{"class":1165,"line":2653},14,[1163,2655,2555],{"class":1210},[1163,2657,2658],{"class":1427}," connected\n",[1030,2660,2662],{"id":2661},"migration-strategies","Migration Strategies",[1026,2664,2665],{},"Transitioning from sync to async Django:",[1026,2667,2668,2671,2672,2675,2676,2679,2680,2682,2683,2686],{},[1045,2669,2670],{},"Gradual Migration",": Start with specific async views and expand incrementally\n",[1045,2673,2674],{},"Hybrid Approach",": Run sync and async views side by side\n",[1045,2677,2678],{},"Service Separation",": Extract async features into separate services\n",[1045,2681,621],{},": Validate async benefits with realistic load testing\n",[1045,2684,2685],{},"Team Training",": Ensure team understands async programming concepts",[1030,2688,2690],{"id":2689},"production-deployment","Production Deployment",[1026,2692,2693],{},"Async Django applications require specific deployment considerations:",[1026,2695,2696,2698,2699,2702,2703,2705,2706,2709,2710,2713],{},[1045,2697,2390],{},": Configure Uvicorn, Gunicorn with async workers\n",[1045,2700,2701],{},"Load Balancing",": Handle WebSocket connections with sticky sessions\n",[1045,2704,1934],{},": Track async-specific metrics and connection pools\n",[1045,2707,2708],{},"Scaling",": Implement horizontal scaling for WebSocket applications\n",[1045,2711,2712],{},"Infrastructure",": Use async-capable databases and caching layers",[1030,2715,2717],{"id":2716},"future-of-async-django","Future of Async Django",[1026,2719,2720],{},"Django's async capabilities continue evolving:",[1026,2722,2723,2726,2727,2730,2731,2734,2735,2738,2739,2742],{},[1045,2724,2725],{},"Enhanced ORM",": Full async ORM support across all operations\n",[1045,2728,2729],{},"Performance Improvements",": Continued optimization of async code paths\n",[1045,2732,2733],{},"Ecosystem Growth",": More async-compatible third-party packages\n",[1045,2736,2737],{},"Developer Experience",": Better tooling and debugging for async applications\n",[1045,2740,2741],{},"Standards Evolution",": ASGI specification improvements and new features",[1030,2744,2746],{"id":2745},"getting-started","Getting Started",[1026,2748,2749],{},"Whether you're building a new real-time application or adding async features to an existing Django project, this guide provides:",[1101,2751,2752,2755,2758,2761,2764],{},[1104,2753,2754],{},"Step-by-step implementation instructions",[1104,2756,2757],{},"Production-ready code examples",[1104,2759,2760],{},"Performance optimization techniques",[1104,2762,2763],{},"Testing and debugging strategies",[1104,2765,2766],{},"Deployment and scaling patterns",[1030,2768,2770],{"id":2769},"example-applications","Example Applications",[1026,2772,2773],{},"Throughout this guide, we'll build several async applications:",[1026,2775,2776,2779,2780,2783,2784,2787,2788,2791,2792,2795],{},[1045,2777,2778],{},"Real-Time Chat",": WebSocket-based chat with user presence and message history\n",[1045,2781,2782],{},"Live Dashboard",": Real-time analytics dashboard with streaming updates\n",[1045,2785,2786],{},"Collaborative Editor",": Multi-user document editing with conflict resolution\n",[1045,2789,2790],{},"Notification System",": Real-time notifications with multiple delivery channels\n",[1045,2793,2794],{},"API Gateway",": High-performance async API with external service integration",[1030,2797,2799],{"id":2798},"best-practices-preview","Best Practices Preview",[1026,2801,2802],{},"Key principles for successful async Django development:",[1026,2804,2805,2808,2809,2811,2812,2815,2816,2819,2820,2822],{},[1045,2806,2807],{},"Async All the Way",": Avoid mixing sync and async code unnecessarily\n",[1045,2810,2438],{},": Properly handle database and external connections\n",[1045,2813,2814],{},"Error Handling",": Implement robust error handling for async operations\n",[1045,2817,2818],{},"Resource Limits",": Set appropriate limits for concurrent operations\n",[1045,2821,1934],{},": Track async-specific performance metrics and bottlenecks",[1030,2824,2826],{"id":2825},"next-steps","Next Steps",[1026,2828,2829],{},"Ready to build high-performance, real-time Django applications? Start with understanding ASGI fundamentals, then progress through async views, WebSocket implementation, and background task processing. Each chapter builds comprehensive async capabilities that enable modern, scalable web applications.",[1026,2831,2832],{},"The journey from traditional synchronous Django to async-powered applications opens new possibilities for user experience, performance, and scalability. Let's explore how Django's async features can transform your applications and enable the next generation of web experiences.",[2834,2835,2836],"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 .sljsM, html code.shiki .sljsM{--shiki-light:#6182B8;--shiki-default:#59873A;--shiki-dark:#80A665}html pre.shiki code .soVBu, html code.shiki .soVBu{--shiki-light:#39ADB5;--shiki-default:#999999;--shiki-dark:#666666}html pre.shiki code .sCyAa, html code.shiki .sCyAa{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#393A34;--shiki-default-font-style:inherit;--shiki-dark:#DBD7CAEE;--shiki-dark-font-style:inherit}html pre.shiki code .siDh9, html code.shiki .siDh9{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#1E754F;--shiki-default-font-style:inherit;--shiki-dark:#4D9375;--shiki-dark-font-style:inherit}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 .sD-vU, html code.shiki .sD-vU{--shiki-light:#E2931D;--shiki-default:#2E8F82;--shiki-dark:#5DA994}html pre.shiki code .sYn-s, html code.shiki .sYn-s{--shiki-light:#E2931D;--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 .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 .siWMO, html code.shiki .siWMO{--shiki-light:#6182B8;--shiki-default:#393A34;--shiki-dark:#DBD7CAEE}html pre.shiki code .sbYkP, html code.shiki .sbYkP{--shiki-light:#39ADB5;--shiki-default:#B5695977;--shiki-dark:#C98A7D77}html pre.shiki code .sTbE_, html code.shiki .sTbE_{--shiki-light:#91B859;--shiki-default:#B56959;--shiki-dark:#C98A7D}html pre.shiki code .sftqT, html code.shiki .sftqT{--shiki-light:#90A4AE;--shiki-default:#393A34;--shiki-dark:#DBD7CAEE}html pre.shiki code .s8XtY, html code.shiki .s8XtY{--shiki-light:#39ADB5;--shiki-default:#1E754F;--shiki-dark:#4D9375}html pre.shiki code .s3h35, html code.shiki .s3h35{--shiki-light:#F76D47;--shiki-default:#A65E2B;--shiki-dark:#C99076}html pre.shiki code .s7CZa, html code.shiki .s7CZa{--shiki-light:#F76D47;--shiki-default:#2F798A;--shiki-dark:#4C9A91}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 .sVsLi, html code.shiki .sVsLi{--shiki-light:#39ADB5;--shiki-default:#AB5959;--shiki-dark:#CB7676}",{"title":1158,"searchDepth":1166,"depth":1173,"links":2838},[2839,2842,2845,2849,2850,2855,2856,2857,2862,2863,2864,2865,2866,2867,2868,2869,2870,2871],{"id":1032,"depth":1173,"text":1033,"children":2840},[2841],{"id":1040,"depth":1201,"text":1041},{"id":1067,"depth":1173,"text":1068,"children":2843},[2844],{"id":1092,"depth":1201,"text":1093},{"id":1143,"depth":1173,"text":1144,"children":2846},[2847,2848],{"id":1147,"depth":1201,"text":1148},{"id":1266,"depth":1201,"text":1267},{"id":1278,"depth":1173,"text":1279},{"id":1312,"depth":1173,"text":1313,"children":2851},[2852,2853,2854],{"id":1316,"depth":1201,"text":1317},{"id":1559,"depth":1201,"text":1560},{"id":1733,"depth":1201,"text":1734},{"id":1864,"depth":1173,"text":1865},{"id":1892,"depth":1173,"text":1893},{"id":1938,"depth":1173,"text":1939,"children":2858},[2859,2860,2861],{"id":1942,"depth":1201,"text":1943},{"id":2143,"depth":1201,"text":2144},{"id":2277,"depth":1201,"text":2278},{"id":2381,"depth":1173,"text":2382},{"id":2413,"depth":1173,"text":2414},{"id":2442,"depth":1173,"text":2443},{"id":2661,"depth":1173,"text":2662},{"id":2689,"depth":1173,"text":2690},{"id":2716,"depth":1173,"text":2717},{"id":2745,"depth":1173,"text":2746},{"id":2769,"depth":1173,"text":2770},{"id":2798,"depth":1173,"text":2799},{"id":2825,"depth":1173,"text":2826},"md",null,{},{"title":703,"description":1028},"qE_meigxV4PMgbttkci4gPnhIFFwEkO9qJmT0gjusB8",[2878,2880],{"title":699,"path":700,"stem":701,"description":2879,"children":-1},"Production Django applications require sophisticated caching architectures that span multiple layers, from browser caches to CDNs, reverse proxies, and application-level caches. This chapter covers enterprise-grade caching patterns, multi-tier architectures, and deployment strategies that enable applications to handle massive scale while maintaining excellent performance and reliability.",{"title":709,"path":710,"stem":711,"description":2881,"children":-1},"ASGI (Asynchronous Server Gateway Interface) is the spiritual successor to WSGI, designed to handle both synchronous and asynchronous Python web applications. Understanding ASGI is fundamental to building modern Django applications that support WebSockets, HTTP/2, and high-concurrency scenarios while maintaining compatibility with traditional synchronous code.",1772474948874]