[{"data":1,"prerenderedAt":7651},["ShallowReactive",2],{"navigation":3,"/deployment/using-wsgi-and-asgi-servers":1016,"/deployment/using-wsgi-and-asgi-servers-surround":7646},[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":747,"body":1018,"description":1028,"extension":7641,"links":7642,"meta":7643,"navigation":1103,"path":748,"seo":7644,"stem":749,"__hash__":7645},"docs/20.deployment/03.using-wsgi-and-asgi-servers.md",{"type":1019,"value":1020,"toc":7609},"minimark",[1021,1025,1029,1034,1039,1042,1165,1172,1188,1192,1195,1414,1419,1433,1437,1440,1444,1897,1901,2754,2758,2935,2991,2995,2998,3002,3289,3293,3646,3650,3653,3657,4381,4385,4631,4635,4762,4766,4769,4773,5021,5025,5090,5094,5098,5460,5464,5842,5846,6753,6757,6761,7602,7605],[1022,1023,747],"h1",{"id":1024},"using-wsgi-and-asgi-servers",[1026,1027,1028],"p",{},"Production Django applications require robust application servers to handle HTTP requests efficiently. This chapter covers configuring and deploying Django applications with WSGI servers (Gunicorn, uWSGI) for traditional synchronous applications and ASGI servers (Uvicorn, Daphne, Hypercorn) for asynchronous applications with WebSocket support.",[1030,1031,1033],"h2",{"id":1032},"understanding-wsgi-vs-asgi","Understanding WSGI vs ASGI",[1035,1036,1038],"h3",{"id":1037},"wsgi-web-server-gateway-interface","WSGI (Web Server Gateway Interface)",[1026,1040,1041],{},"WSGI is the traditional Python web server interface for synchronous applications:",[1043,1044,1049],"pre",{"className":1045,"code":1046,"language":1047,"meta":1048,"style":1048},"language-python shiki shiki-themes material-theme-lighter vitesse-light vitesse-dark","# wsgi.py\nimport os\nfrom django.core.wsgi import get_wsgi_application\n\nos.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings.production')\napplication = get_wsgi_application()\n","python","",[1050,1051,1052,1061,1072,1098,1105,1150],"code",{"__ignoreMap":1048},[1053,1054,1057],"span",{"class":1055,"line":1056},"line",1,[1053,1058,1060],{"class":1059},"s9Tkl","# wsgi.py\n",[1053,1062,1064,1068],{"class":1055,"line":1063},2,[1053,1065,1067],{"class":1066},"siDh9","import",[1053,1069,1071],{"class":1070},"sftqT"," os\n",[1053,1073,1075,1078,1081,1085,1088,1090,1093,1095],{"class":1055,"line":1074},3,[1053,1076,1077],{"class":1066},"from",[1053,1079,1080],{"class":1070}," django",[1053,1082,1084],{"class":1083},"soVBu",".",[1053,1086,1087],{"class":1070},"core",[1053,1089,1084],{"class":1083},[1053,1091,1092],{"class":1070},"wsgi ",[1053,1094,1067],{"class":1066},[1053,1096,1097],{"class":1070}," get_wsgi_application\n",[1053,1099,1101],{"class":1055,"line":1100},4,[1053,1102,1104],{"emptyLinePlaceholder":1103},true,"\n",[1053,1106,1108,1111,1113,1117,1119,1123,1126,1130,1134,1136,1139,1142,1145,1147],{"class":1055,"line":1107},5,[1053,1109,1110],{"class":1070},"os",[1053,1112,1084],{"class":1083},[1053,1114,1116],{"class":1115},"sBPpx","environ",[1053,1118,1084],{"class":1083},[1053,1120,1122],{"class":1121},"siWMO","setdefault",[1053,1124,1125],{"class":1083},"(",[1053,1127,1129],{"class":1128},"sbYkP","'",[1053,1131,1133],{"class":1132},"sTbE_","DJANGO_SETTINGS_MODULE",[1053,1135,1129],{"class":1128},[1053,1137,1138],{"class":1083},",",[1053,1140,1141],{"class":1128}," '",[1053,1143,1144],{"class":1132},"myproject.settings.production",[1053,1146,1129],{"class":1128},[1053,1148,1149],{"class":1083},")\n",[1053,1151,1153,1156,1159,1162],{"class":1055,"line":1152},6,[1053,1154,1155],{"class":1070},"application ",[1053,1157,1158],{"class":1083},"=",[1053,1160,1161],{"class":1121}," get_wsgi_application",[1053,1163,1164],{"class":1083},"()\n",[1026,1166,1167,1171],{},[1168,1169,1170],"strong",{},"Use WSGI when",":",[1173,1174,1175,1179,1182,1185],"ul",{},[1176,1177,1178],"li",{},"Building traditional synchronous Django applications",[1176,1180,1181],{},"No real-time features or WebSocket requirements",[1176,1183,1184],{},"Using synchronous database operations and third-party libraries",[1176,1186,1187],{},"Maximum compatibility with existing infrastructure",[1035,1189,1191],{"id":1190},"asgi-asynchronous-server-gateway-interface","ASGI (Asynchronous Server Gateway Interface)",[1026,1193,1194],{},"ASGI supports both synchronous and asynchronous applications with WebSocket capabilities:",[1043,1196,1198],{"className":1045,"code":1197,"language":1047,"meta":1048,"style":1048},"# asgi.py\nimport os\nfrom django.core.asgi import get_asgi_application\nfrom channels.routing import ProtocolTypeRouter, URLRouter\nfrom channels.auth import AuthMiddlewareStack\nimport myapp.routing\n\nos.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings.production')\n\napplication = ProtocolTypeRouter({\n    \"http\": get_asgi_application(),\n    \"websocket\": AuthMiddlewareStack(\n        URLRouter(\n            myapp.routing.websocket_urlpatterns\n        )\n    ),\n})\n",[1050,1199,1200,1205,1211,1231,1253,1269,1281,1286,1317,1322,1334,1354,1372,1380,1396,1402,1408],{"__ignoreMap":1048},[1053,1201,1202],{"class":1055,"line":1056},[1053,1203,1204],{"class":1059},"# asgi.py\n",[1053,1206,1207,1209],{"class":1055,"line":1063},[1053,1208,1067],{"class":1066},[1053,1210,1071],{"class":1070},[1053,1212,1213,1215,1217,1219,1221,1223,1226,1228],{"class":1055,"line":1074},[1053,1214,1077],{"class":1066},[1053,1216,1080],{"class":1070},[1053,1218,1084],{"class":1083},[1053,1220,1087],{"class":1070},[1053,1222,1084],{"class":1083},[1053,1224,1225],{"class":1070},"asgi ",[1053,1227,1067],{"class":1066},[1053,1229,1230],{"class":1070}," get_asgi_application\n",[1053,1232,1233,1235,1238,1240,1243,1245,1248,1250],{"class":1055,"line":1100},[1053,1234,1077],{"class":1066},[1053,1236,1237],{"class":1070}," channels",[1053,1239,1084],{"class":1083},[1053,1241,1242],{"class":1070},"routing ",[1053,1244,1067],{"class":1066},[1053,1246,1247],{"class":1070}," ProtocolTypeRouter",[1053,1249,1138],{"class":1083},[1053,1251,1252],{"class":1070}," URLRouter\n",[1053,1254,1255,1257,1259,1261,1264,1266],{"class":1055,"line":1107},[1053,1256,1077],{"class":1066},[1053,1258,1237],{"class":1070},[1053,1260,1084],{"class":1083},[1053,1262,1263],{"class":1070},"auth ",[1053,1265,1067],{"class":1066},[1053,1267,1268],{"class":1070}," AuthMiddlewareStack\n",[1053,1270,1271,1273,1276,1278],{"class":1055,"line":1152},[1053,1272,1067],{"class":1066},[1053,1274,1275],{"class":1070}," myapp",[1053,1277,1084],{"class":1083},[1053,1279,1280],{"class":1115},"routing\n",[1053,1282,1284],{"class":1055,"line":1283},7,[1053,1285,1104],{"emptyLinePlaceholder":1103},[1053,1287,1289,1291,1293,1295,1297,1299,1301,1303,1305,1307,1309,1311,1313,1315],{"class":1055,"line":1288},8,[1053,1290,1110],{"class":1070},[1053,1292,1084],{"class":1083},[1053,1294,1116],{"class":1115},[1053,1296,1084],{"class":1083},[1053,1298,1122],{"class":1121},[1053,1300,1125],{"class":1083},[1053,1302,1129],{"class":1128},[1053,1304,1133],{"class":1132},[1053,1306,1129],{"class":1128},[1053,1308,1138],{"class":1083},[1053,1310,1141],{"class":1128},[1053,1312,1144],{"class":1132},[1053,1314,1129],{"class":1128},[1053,1316,1149],{"class":1083},[1053,1318,1320],{"class":1055,"line":1319},9,[1053,1321,1104],{"emptyLinePlaceholder":1103},[1053,1323,1325,1327,1329,1331],{"class":1055,"line":1324},10,[1053,1326,1155],{"class":1070},[1053,1328,1158],{"class":1083},[1053,1330,1247],{"class":1121},[1053,1332,1333],{"class":1083},"({\n",[1053,1335,1337,1340,1343,1346,1348,1351],{"class":1055,"line":1336},11,[1053,1338,1339],{"class":1128},"    \"",[1053,1341,1342],{"class":1132},"http",[1053,1344,1345],{"class":1128},"\"",[1053,1347,1171],{"class":1083},[1053,1349,1350],{"class":1121}," get_asgi_application",[1053,1352,1353],{"class":1083},"(),\n",[1053,1355,1357,1359,1362,1364,1366,1369],{"class":1055,"line":1356},12,[1053,1358,1339],{"class":1128},[1053,1360,1361],{"class":1132},"websocket",[1053,1363,1345],{"class":1128},[1053,1365,1171],{"class":1083},[1053,1367,1368],{"class":1121}," AuthMiddlewareStack",[1053,1370,1371],{"class":1083},"(\n",[1053,1373,1375,1378],{"class":1055,"line":1374},13,[1053,1376,1377],{"class":1121},"        URLRouter",[1053,1379,1371],{"class":1083},[1053,1381,1383,1386,1388,1391,1393],{"class":1055,"line":1382},14,[1053,1384,1385],{"class":1121},"            myapp",[1053,1387,1084],{"class":1083},[1053,1389,1390],{"class":1115},"routing",[1053,1392,1084],{"class":1083},[1053,1394,1395],{"class":1115},"websocket_urlpatterns\n",[1053,1397,1399],{"class":1055,"line":1398},15,[1053,1400,1401],{"class":1083},"        )\n",[1053,1403,1405],{"class":1055,"line":1404},16,[1053,1406,1407],{"class":1083},"    ),\n",[1053,1409,1411],{"class":1055,"line":1410},17,[1053,1412,1413],{"class":1083},"})\n",[1026,1415,1416,1171],{},[1168,1417,1418],{},"Use ASGI when",[1173,1420,1421,1424,1427,1430],{},[1176,1422,1423],{},"Building applications with real-time features",[1176,1425,1426],{},"Using WebSockets for live updates",[1176,1428,1429],{},"Implementing async views and database operations",[1176,1431,1432],{},"Requiring high concurrency for I/O-bound operations",[1030,1434,1436],{"id":1435},"gunicorn-wsgi-server","Gunicorn (WSGI Server)",[1026,1438,1439],{},"Gunicorn is the most popular WSGI server for Django applications, offering excellent performance and reliability.",[1035,1441,1443],{"id":1442},"basic-gunicorn-configuration","Basic Gunicorn Configuration",[1043,1445,1447],{"className":1045,"code":1446,"language":1047,"meta":1048,"style":1048},"# gunicorn.conf.py\nimport multiprocessing\nimport os\n\n# Server socket\nbind = \"0.0.0.0:8000\"\nbacklog = 2048\n\n# Worker processes\nworkers = multiprocessing.cpu_count() * 2 + 1\nworker_class = \"sync\"\nworker_connections = 1000\ntimeout = 30\nkeepalive = 2\n\n# Restart workers after this many requests, to prevent memory leaks\nmax_requests = 1000\nmax_requests_jitter = 50\n\n# Logging\naccesslog = \"/var/log/gunicorn/access.log\"\nerrorlog = \"/var/log/gunicorn/error.log\"\nloglevel = \"info\"\naccess_log_format = '%(h)s %(l)s %(u)s %(t)s \"%(r)s\" %(s)s %(b)s \"%(f)s\" \"%(a)s\" %(D)s'\n\n# Process naming\nproc_name = 'django_app'\n\n# Server mechanics\ndaemon = False\npidfile = '/var/run/gunicorn/django_app.pid'\nuser = 'django'\ngroup = 'django'\ntmp_upload_dir = None\n\n# SSL (if terminating SSL at application level)\n# keyfile = '/path/to/keyfile'\n# certfile = '/path/to/certfile'\n\n# Environment variables\nraw_env = [\n    'DJANGO_SETTINGS_MODULE=myproject.settings.production',\n]\n",[1050,1448,1449,1454,1461,1467,1471,1476,1492,1503,1507,1512,1543,1557,1567,1577,1587,1591,1596,1605,1616,1621,1627,1642,1657,1672,1728,1733,1739,1754,1759,1765,1777,1792,1807,1821,1832,1837,1843,1849,1855,1860,1866,1877,1891],{"__ignoreMap":1048},[1053,1450,1451],{"class":1055,"line":1056},[1053,1452,1453],{"class":1059},"# gunicorn.conf.py\n",[1053,1455,1456,1458],{"class":1055,"line":1063},[1053,1457,1067],{"class":1066},[1053,1459,1460],{"class":1070}," multiprocessing\n",[1053,1462,1463,1465],{"class":1055,"line":1074},[1053,1464,1067],{"class":1066},[1053,1466,1071],{"class":1070},[1053,1468,1469],{"class":1055,"line":1100},[1053,1470,1104],{"emptyLinePlaceholder":1103},[1053,1472,1473],{"class":1055,"line":1107},[1053,1474,1475],{"class":1059},"# Server socket\n",[1053,1477,1478,1481,1483,1486,1489],{"class":1055,"line":1152},[1053,1479,1480],{"class":1070},"bind ",[1053,1482,1158],{"class":1083},[1053,1484,1485],{"class":1128}," \"",[1053,1487,1488],{"class":1132},"0.0.0.0:8000",[1053,1490,1491],{"class":1128},"\"\n",[1053,1493,1494,1497,1499],{"class":1055,"line":1283},[1053,1495,1496],{"class":1070},"backlog ",[1053,1498,1158],{"class":1083},[1053,1500,1502],{"class":1501},"s7CZa"," 2048\n",[1053,1504,1505],{"class":1055,"line":1288},[1053,1506,1104],{"emptyLinePlaceholder":1103},[1053,1508,1509],{"class":1055,"line":1319},[1053,1510,1511],{"class":1059},"# Worker processes\n",[1053,1513,1514,1517,1519,1522,1524,1527,1530,1534,1537,1540],{"class":1055,"line":1324},[1053,1515,1516],{"class":1070},"workers ",[1053,1518,1158],{"class":1083},[1053,1520,1521],{"class":1070}," multiprocessing",[1053,1523,1084],{"class":1083},[1053,1525,1526],{"class":1121},"cpu_count",[1053,1528,1529],{"class":1083},"()",[1053,1531,1533],{"class":1532},"sVsLi"," *",[1053,1535,1536],{"class":1501}," 2",[1053,1538,1539],{"class":1532}," +",[1053,1541,1542],{"class":1501}," 1\n",[1053,1544,1545,1548,1550,1552,1555],{"class":1055,"line":1336},[1053,1546,1547],{"class":1070},"worker_class ",[1053,1549,1158],{"class":1083},[1053,1551,1485],{"class":1128},[1053,1553,1554],{"class":1132},"sync",[1053,1556,1491],{"class":1128},[1053,1558,1559,1562,1564],{"class":1055,"line":1356},[1053,1560,1561],{"class":1070},"worker_connections ",[1053,1563,1158],{"class":1083},[1053,1565,1566],{"class":1501}," 1000\n",[1053,1568,1569,1572,1574],{"class":1055,"line":1374},[1053,1570,1571],{"class":1070},"timeout ",[1053,1573,1158],{"class":1083},[1053,1575,1576],{"class":1501}," 30\n",[1053,1578,1579,1582,1584],{"class":1055,"line":1382},[1053,1580,1581],{"class":1070},"keepalive ",[1053,1583,1158],{"class":1083},[1053,1585,1586],{"class":1501}," 2\n",[1053,1588,1589],{"class":1055,"line":1398},[1053,1590,1104],{"emptyLinePlaceholder":1103},[1053,1592,1593],{"class":1055,"line":1404},[1053,1594,1595],{"class":1059},"# Restart workers after this many requests, to prevent memory leaks\n",[1053,1597,1598,1601,1603],{"class":1055,"line":1410},[1053,1599,1600],{"class":1070},"max_requests ",[1053,1602,1158],{"class":1083},[1053,1604,1566],{"class":1501},[1053,1606,1608,1611,1613],{"class":1055,"line":1607},18,[1053,1609,1610],{"class":1070},"max_requests_jitter ",[1053,1612,1158],{"class":1083},[1053,1614,1615],{"class":1501}," 50\n",[1053,1617,1619],{"class":1055,"line":1618},19,[1053,1620,1104],{"emptyLinePlaceholder":1103},[1053,1622,1624],{"class":1055,"line":1623},20,[1053,1625,1626],{"class":1059},"# Logging\n",[1053,1628,1630,1633,1635,1637,1640],{"class":1055,"line":1629},21,[1053,1631,1632],{"class":1070},"accesslog ",[1053,1634,1158],{"class":1083},[1053,1636,1485],{"class":1128},[1053,1638,1639],{"class":1132},"/var/log/gunicorn/access.log",[1053,1641,1491],{"class":1128},[1053,1643,1645,1648,1650,1652,1655],{"class":1055,"line":1644},22,[1053,1646,1647],{"class":1070},"errorlog ",[1053,1649,1158],{"class":1083},[1053,1651,1485],{"class":1128},[1053,1653,1654],{"class":1132},"/var/log/gunicorn/error.log",[1053,1656,1491],{"class":1128},[1053,1658,1660,1663,1665,1667,1670],{"class":1055,"line":1659},23,[1053,1661,1662],{"class":1070},"loglevel ",[1053,1664,1158],{"class":1083},[1053,1666,1485],{"class":1128},[1053,1668,1669],{"class":1132},"info",[1053,1671,1491],{"class":1128},[1053,1673,1675,1678,1680,1682,1686,1689,1692,1695,1697,1700,1703,1706,1709,1711,1714,1717,1720,1722,1725],{"class":1055,"line":1674},24,[1053,1676,1677],{"class":1070},"access_log_format ",[1053,1679,1158],{"class":1083},[1053,1681,1141],{"class":1128},[1053,1683,1685],{"class":1684},"s3h35","%(h)s",[1053,1687,1688],{"class":1684}," %(l)s",[1053,1690,1691],{"class":1684}," %(u)s",[1053,1693,1694],{"class":1684}," %(t)s",[1053,1696,1485],{"class":1132},[1053,1698,1699],{"class":1684},"%(r)s",[1053,1701,1702],{"class":1132},"\" ",[1053,1704,1705],{"class":1684},"%(s)s",[1053,1707,1708],{"class":1684}," %(b)s",[1053,1710,1485],{"class":1132},[1053,1712,1713],{"class":1684},"%(f)s",[1053,1715,1716],{"class":1132},"\" \"",[1053,1718,1719],{"class":1684},"%(a)s",[1053,1721,1702],{"class":1132},[1053,1723,1724],{"class":1684},"%(D)s",[1053,1726,1727],{"class":1128},"'\n",[1053,1729,1731],{"class":1055,"line":1730},25,[1053,1732,1104],{"emptyLinePlaceholder":1103},[1053,1734,1736],{"class":1055,"line":1735},26,[1053,1737,1738],{"class":1059},"# Process naming\n",[1053,1740,1742,1745,1747,1749,1752],{"class":1055,"line":1741},27,[1053,1743,1744],{"class":1070},"proc_name ",[1053,1746,1158],{"class":1083},[1053,1748,1141],{"class":1128},[1053,1750,1751],{"class":1132},"django_app",[1053,1753,1727],{"class":1128},[1053,1755,1757],{"class":1055,"line":1756},28,[1053,1758,1104],{"emptyLinePlaceholder":1103},[1053,1760,1762],{"class":1055,"line":1761},29,[1053,1763,1764],{"class":1059},"# Server mechanics\n",[1053,1766,1768,1771,1773],{"class":1055,"line":1767},30,[1053,1769,1770],{"class":1070},"daemon ",[1053,1772,1158],{"class":1083},[1053,1774,1776],{"class":1775},"s8XtY"," False\n",[1053,1778,1780,1783,1785,1787,1790],{"class":1055,"line":1779},31,[1053,1781,1782],{"class":1070},"pidfile ",[1053,1784,1158],{"class":1083},[1053,1786,1141],{"class":1128},[1053,1788,1789],{"class":1132},"/var/run/gunicorn/django_app.pid",[1053,1791,1727],{"class":1128},[1053,1793,1795,1798,1800,1802,1805],{"class":1055,"line":1794},32,[1053,1796,1797],{"class":1070},"user ",[1053,1799,1158],{"class":1083},[1053,1801,1141],{"class":1128},[1053,1803,1804],{"class":1132},"django",[1053,1806,1727],{"class":1128},[1053,1808,1810,1813,1815,1817,1819],{"class":1055,"line":1809},33,[1053,1811,1812],{"class":1070},"group ",[1053,1814,1158],{"class":1083},[1053,1816,1141],{"class":1128},[1053,1818,1804],{"class":1132},[1053,1820,1727],{"class":1128},[1053,1822,1824,1827,1829],{"class":1055,"line":1823},34,[1053,1825,1826],{"class":1070},"tmp_upload_dir ",[1053,1828,1158],{"class":1083},[1053,1830,1831],{"class":1775}," None\n",[1053,1833,1835],{"class":1055,"line":1834},35,[1053,1836,1104],{"emptyLinePlaceholder":1103},[1053,1838,1840],{"class":1055,"line":1839},36,[1053,1841,1842],{"class":1059},"# SSL (if terminating SSL at application level)\n",[1053,1844,1846],{"class":1055,"line":1845},37,[1053,1847,1848],{"class":1059},"# keyfile = '/path/to/keyfile'\n",[1053,1850,1852],{"class":1055,"line":1851},38,[1053,1853,1854],{"class":1059},"# certfile = '/path/to/certfile'\n",[1053,1856,1858],{"class":1055,"line":1857},39,[1053,1859,1104],{"emptyLinePlaceholder":1103},[1053,1861,1863],{"class":1055,"line":1862},40,[1053,1864,1865],{"class":1059},"# Environment variables\n",[1053,1867,1869,1872,1874],{"class":1055,"line":1868},41,[1053,1870,1871],{"class":1070},"raw_env ",[1053,1873,1158],{"class":1083},[1053,1875,1876],{"class":1083}," [\n",[1053,1878,1880,1883,1886,1888],{"class":1055,"line":1879},42,[1053,1881,1882],{"class":1128},"    '",[1053,1884,1885],{"class":1132},"DJANGO_SETTINGS_MODULE=myproject.settings.production",[1053,1887,1129],{"class":1128},[1053,1889,1890],{"class":1083},",\n",[1053,1892,1894],{"class":1055,"line":1893},43,[1053,1895,1896],{"class":1083},"]\n",[1035,1898,1900],{"id":1899},"advanced-gunicorn-configuration","Advanced Gunicorn Configuration",[1043,1902,1904],{"className":1045,"code":1903,"language":1047,"meta":1048,"style":1048},"# gunicorn_advanced.conf.py\nimport multiprocessing\nimport os\n\n# Determine optimal worker count based on workload\ndef get_workers():\n    cpu_count = multiprocessing.cpu_count()\n    # For CPU-bound applications\n    if os.environ.get('WORKLOAD_TYPE') == 'cpu':\n        return cpu_count\n    # For I/O-bound applications (default)\n    else:\n        return cpu_count * 2 + 1\n\n# Server socket configuration\nbind = [\n    \"127.0.0.1:8000\",  # Local interface\n    \"unix:/var/run/gunicorn/django_app.sock\"  # Unix socket\n]\nbacklog = 2048\n\n# Worker configuration\nworkers = get_workers()\nworker_class = \"gevent\"  # Async worker for better I/O handling\nworker_connections = 1000\ntimeout = 120  # Longer timeout for complex requests\nkeepalive = 5\n\n# Memory management\nmax_requests = 1000\nmax_requests_jitter = 100\npreload_app = True  # Preload application for memory efficiency\n\n# Graceful restarts\ngraceful_timeout = 30\n\n# Logging configuration\naccesslog = \"/var/log/gunicorn/access.log\"\nerrorlog = \"/var/log/gunicorn/error.log\"\nloglevel = \"info\"\ncapture_output = True\nenable_stdio_inheritance = True\n\n# Custom log format with timing\naccess_log_format = (\n    '%(h)s %(l)s %(u)s %(t)s \"%(r)s\" %(s)s %(b)s '\n    '\"%(f)s\" \"%(a)s\" %(D)s %(p)s'\n)\n\n# Security\nlimit_request_line = 4094\nlimit_request_fields = 100\nlimit_request_field_size = 8190\n\n# Performance tuning\nworker_tmp_dir = \"/dev/shm\"  # Use RAM for temporary files\nforwarded_allow_ips = \"127.0.0.1,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16\"\n\n# Hooks for custom behavior\ndef on_starting(server):\n    server.log.info(\"Server is starting\")\n\ndef on_reload(server):\n    server.log.info(\"Server is reloading\")\n\ndef worker_int(worker):\n    worker.log.info(\"Worker received INT or QUIT signal\")\n\ndef pre_fork(server, worker):\n    server.log.info(\"Worker spawned (pid: %s)\", worker.pid)\n\ndef post_fork(server, worker):\n    server.log.info(\"Worker spawned (pid: %s)\", worker.pid)\n    # Initialize worker-specific resources here\n\ndef worker_abort(worker):\n    worker.log.info(\"Worker received SIGABRT signal\")\n",[1050,1905,1906,1911,1917,1923,1927,1932,1945,1960,1965,2007,2015,2020,2027,2043,2047,2052,2060,2074,2086,2090,2098,2102,2107,2117,2133,2141,2153,2162,2166,2171,2179,2188,2201,2205,2210,2219,2223,2228,2240,2252,2264,2274,2283,2287,2293,2303,2329,2351,2356,2361,2367,2378,2388,2399,2404,2410,2428,2443,2448,2454,2471,2497,2502,2516,2540,2545,2560,2585,2590,2609,2647,2652,2670,2705,2711,2716,2730],{"__ignoreMap":1048},[1053,1907,1908],{"class":1055,"line":1056},[1053,1909,1910],{"class":1059},"# gunicorn_advanced.conf.py\n",[1053,1912,1913,1915],{"class":1055,"line":1063},[1053,1914,1067],{"class":1066},[1053,1916,1460],{"class":1070},[1053,1918,1919,1921],{"class":1055,"line":1074},[1053,1920,1067],{"class":1066},[1053,1922,1071],{"class":1070},[1053,1924,1925],{"class":1055,"line":1100},[1053,1926,1104],{"emptyLinePlaceholder":1103},[1053,1928,1929],{"class":1055,"line":1107},[1053,1930,1931],{"class":1059},"# Determine optimal worker count based on workload\n",[1053,1933,1934,1938,1942],{"class":1055,"line":1152},[1053,1935,1937],{"class":1936},"s5Kfy","def",[1053,1939,1941],{"class":1940},"sljsM"," get_workers",[1053,1943,1944],{"class":1083},"():\n",[1053,1946,1947,1950,1952,1954,1956,1958],{"class":1055,"line":1283},[1053,1948,1949],{"class":1070},"    cpu_count ",[1053,1951,1158],{"class":1083},[1053,1953,1521],{"class":1070},[1053,1955,1084],{"class":1083},[1053,1957,1526],{"class":1121},[1053,1959,1164],{"class":1083},[1053,1961,1962],{"class":1055,"line":1288},[1053,1963,1964],{"class":1059},"    # For CPU-bound applications\n",[1053,1966,1967,1970,1973,1975,1977,1979,1982,1984,1986,1989,1991,1994,1997,1999,2002,2004],{"class":1055,"line":1319},[1053,1968,1969],{"class":1066},"    if",[1053,1971,1972],{"class":1070}," os",[1053,1974,1084],{"class":1083},[1053,1976,1116],{"class":1115},[1053,1978,1084],{"class":1083},[1053,1980,1981],{"class":1121},"get",[1053,1983,1125],{"class":1083},[1053,1985,1129],{"class":1128},[1053,1987,1988],{"class":1132},"WORKLOAD_TYPE",[1053,1990,1129],{"class":1128},[1053,1992,1993],{"class":1083},")",[1053,1995,1996],{"class":1532}," ==",[1053,1998,1141],{"class":1128},[1053,2000,2001],{"class":1132},"cpu",[1053,2003,1129],{"class":1128},[1053,2005,2006],{"class":1083},":\n",[1053,2008,2009,2012],{"class":1055,"line":1324},[1053,2010,2011],{"class":1066},"        return",[1053,2013,2014],{"class":1070}," cpu_count\n",[1053,2016,2017],{"class":1055,"line":1336},[1053,2018,2019],{"class":1059},"    # For I/O-bound applications (default)\n",[1053,2021,2022,2025],{"class":1055,"line":1356},[1053,2023,2024],{"class":1066},"    else",[1053,2026,2006],{"class":1083},[1053,2028,2029,2031,2034,2037,2039,2041],{"class":1055,"line":1374},[1053,2030,2011],{"class":1066},[1053,2032,2033],{"class":1070}," cpu_count ",[1053,2035,2036],{"class":1532},"*",[1053,2038,1536],{"class":1501},[1053,2040,1539],{"class":1532},[1053,2042,1542],{"class":1501},[1053,2044,2045],{"class":1055,"line":1382},[1053,2046,1104],{"emptyLinePlaceholder":1103},[1053,2048,2049],{"class":1055,"line":1398},[1053,2050,2051],{"class":1059},"# Server socket configuration\n",[1053,2053,2054,2056,2058],{"class":1055,"line":1404},[1053,2055,1480],{"class":1070},[1053,2057,1158],{"class":1083},[1053,2059,1876],{"class":1083},[1053,2061,2062,2064,2067,2069,2071],{"class":1055,"line":1410},[1053,2063,1339],{"class":1128},[1053,2065,2066],{"class":1132},"127.0.0.1:8000",[1053,2068,1345],{"class":1128},[1053,2070,1138],{"class":1083},[1053,2072,2073],{"class":1059},"  # Local interface\n",[1053,2075,2076,2078,2081,2083],{"class":1055,"line":1607},[1053,2077,1339],{"class":1128},[1053,2079,2080],{"class":1132},"unix:/var/run/gunicorn/django_app.sock",[1053,2082,1345],{"class":1128},[1053,2084,2085],{"class":1059},"  # Unix socket\n",[1053,2087,2088],{"class":1055,"line":1618},[1053,2089,1896],{"class":1083},[1053,2091,2092,2094,2096],{"class":1055,"line":1623},[1053,2093,1496],{"class":1070},[1053,2095,1158],{"class":1083},[1053,2097,1502],{"class":1501},[1053,2099,2100],{"class":1055,"line":1629},[1053,2101,1104],{"emptyLinePlaceholder":1103},[1053,2103,2104],{"class":1055,"line":1644},[1053,2105,2106],{"class":1059},"# Worker configuration\n",[1053,2108,2109,2111,2113,2115],{"class":1055,"line":1659},[1053,2110,1516],{"class":1070},[1053,2112,1158],{"class":1083},[1053,2114,1941],{"class":1121},[1053,2116,1164],{"class":1083},[1053,2118,2119,2121,2123,2125,2128,2130],{"class":1055,"line":1674},[1053,2120,1547],{"class":1070},[1053,2122,1158],{"class":1083},[1053,2124,1485],{"class":1128},[1053,2126,2127],{"class":1132},"gevent",[1053,2129,1345],{"class":1128},[1053,2131,2132],{"class":1059},"  # Async worker for better I/O handling\n",[1053,2134,2135,2137,2139],{"class":1055,"line":1730},[1053,2136,1561],{"class":1070},[1053,2138,1158],{"class":1083},[1053,2140,1566],{"class":1501},[1053,2142,2143,2145,2147,2150],{"class":1055,"line":1735},[1053,2144,1571],{"class":1070},[1053,2146,1158],{"class":1083},[1053,2148,2149],{"class":1501}," 120",[1053,2151,2152],{"class":1059},"  # Longer timeout for complex requests\n",[1053,2154,2155,2157,2159],{"class":1055,"line":1741},[1053,2156,1581],{"class":1070},[1053,2158,1158],{"class":1083},[1053,2160,2161],{"class":1501}," 5\n",[1053,2163,2164],{"class":1055,"line":1756},[1053,2165,1104],{"emptyLinePlaceholder":1103},[1053,2167,2168],{"class":1055,"line":1761},[1053,2169,2170],{"class":1059},"# Memory management\n",[1053,2172,2173,2175,2177],{"class":1055,"line":1767},[1053,2174,1600],{"class":1070},[1053,2176,1158],{"class":1083},[1053,2178,1566],{"class":1501},[1053,2180,2181,2183,2185],{"class":1055,"line":1779},[1053,2182,1610],{"class":1070},[1053,2184,1158],{"class":1083},[1053,2186,2187],{"class":1501}," 100\n",[1053,2189,2190,2193,2195,2198],{"class":1055,"line":1794},[1053,2191,2192],{"class":1070},"preload_app ",[1053,2194,1158],{"class":1083},[1053,2196,2197],{"class":1775}," True",[1053,2199,2200],{"class":1059},"  # Preload application for memory efficiency\n",[1053,2202,2203],{"class":1055,"line":1809},[1053,2204,1104],{"emptyLinePlaceholder":1103},[1053,2206,2207],{"class":1055,"line":1823},[1053,2208,2209],{"class":1059},"# Graceful restarts\n",[1053,2211,2212,2215,2217],{"class":1055,"line":1834},[1053,2213,2214],{"class":1070},"graceful_timeout ",[1053,2216,1158],{"class":1083},[1053,2218,1576],{"class":1501},[1053,2220,2221],{"class":1055,"line":1839},[1053,2222,1104],{"emptyLinePlaceholder":1103},[1053,2224,2225],{"class":1055,"line":1845},[1053,2226,2227],{"class":1059},"# Logging configuration\n",[1053,2229,2230,2232,2234,2236,2238],{"class":1055,"line":1851},[1053,2231,1632],{"class":1070},[1053,2233,1158],{"class":1083},[1053,2235,1485],{"class":1128},[1053,2237,1639],{"class":1132},[1053,2239,1491],{"class":1128},[1053,2241,2242,2244,2246,2248,2250],{"class":1055,"line":1857},[1053,2243,1647],{"class":1070},[1053,2245,1158],{"class":1083},[1053,2247,1485],{"class":1128},[1053,2249,1654],{"class":1132},[1053,2251,1491],{"class":1128},[1053,2253,2254,2256,2258,2260,2262],{"class":1055,"line":1862},[1053,2255,1662],{"class":1070},[1053,2257,1158],{"class":1083},[1053,2259,1485],{"class":1128},[1053,2261,1669],{"class":1132},[1053,2263,1491],{"class":1128},[1053,2265,2266,2269,2271],{"class":1055,"line":1868},[1053,2267,2268],{"class":1070},"capture_output ",[1053,2270,1158],{"class":1083},[1053,2272,2273],{"class":1775}," True\n",[1053,2275,2276,2279,2281],{"class":1055,"line":1879},[1053,2277,2278],{"class":1070},"enable_stdio_inheritance ",[1053,2280,1158],{"class":1083},[1053,2282,2273],{"class":1775},[1053,2284,2285],{"class":1055,"line":1893},[1053,2286,1104],{"emptyLinePlaceholder":1103},[1053,2288,2290],{"class":1055,"line":2289},44,[1053,2291,2292],{"class":1059},"# Custom log format with timing\n",[1053,2294,2296,2298,2300],{"class":1055,"line":2295},45,[1053,2297,1677],{"class":1070},[1053,2299,1158],{"class":1083},[1053,2301,2302],{"class":1083}," (\n",[1053,2304,2306,2308,2310,2312,2314,2316,2318,2320,2322,2324,2326],{"class":1055,"line":2305},46,[1053,2307,1882],{"class":1128},[1053,2309,1685],{"class":1684},[1053,2311,1688],{"class":1684},[1053,2313,1691],{"class":1684},[1053,2315,1694],{"class":1684},[1053,2317,1485],{"class":1132},[1053,2319,1699],{"class":1684},[1053,2321,1702],{"class":1132},[1053,2323,1705],{"class":1684},[1053,2325,1708],{"class":1684},[1053,2327,2328],{"class":1128}," '\n",[1053,2330,2332,2334,2336,2338,2340,2342,2344,2346,2349],{"class":1055,"line":2331},47,[1053,2333,1882],{"class":1128},[1053,2335,1345],{"class":1132},[1053,2337,1713],{"class":1684},[1053,2339,1716],{"class":1132},[1053,2341,1719],{"class":1684},[1053,2343,1702],{"class":1132},[1053,2345,1724],{"class":1684},[1053,2347,2348],{"class":1684}," %(p)s",[1053,2350,1727],{"class":1128},[1053,2352,2354],{"class":1055,"line":2353},48,[1053,2355,1149],{"class":1083},[1053,2357,2359],{"class":1055,"line":2358},49,[1053,2360,1104],{"emptyLinePlaceholder":1103},[1053,2362,2364],{"class":1055,"line":2363},50,[1053,2365,2366],{"class":1059},"# Security\n",[1053,2368,2370,2373,2375],{"class":1055,"line":2369},51,[1053,2371,2372],{"class":1070},"limit_request_line ",[1053,2374,1158],{"class":1083},[1053,2376,2377],{"class":1501}," 4094\n",[1053,2379,2381,2384,2386],{"class":1055,"line":2380},52,[1053,2382,2383],{"class":1070},"limit_request_fields ",[1053,2385,1158],{"class":1083},[1053,2387,2187],{"class":1501},[1053,2389,2391,2394,2396],{"class":1055,"line":2390},53,[1053,2392,2393],{"class":1070},"limit_request_field_size ",[1053,2395,1158],{"class":1083},[1053,2397,2398],{"class":1501}," 8190\n",[1053,2400,2402],{"class":1055,"line":2401},54,[1053,2403,1104],{"emptyLinePlaceholder":1103},[1053,2405,2407],{"class":1055,"line":2406},55,[1053,2408,2409],{"class":1059},"# Performance tuning\n",[1053,2411,2413,2416,2418,2420,2423,2425],{"class":1055,"line":2412},56,[1053,2414,2415],{"class":1070},"worker_tmp_dir ",[1053,2417,1158],{"class":1083},[1053,2419,1485],{"class":1128},[1053,2421,2422],{"class":1132},"/dev/shm",[1053,2424,1345],{"class":1128},[1053,2426,2427],{"class":1059},"  # Use RAM for temporary files\n",[1053,2429,2431,2434,2436,2438,2441],{"class":1055,"line":2430},57,[1053,2432,2433],{"class":1070},"forwarded_allow_ips ",[1053,2435,1158],{"class":1083},[1053,2437,1485],{"class":1128},[1053,2439,2440],{"class":1132},"127.0.0.1,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",[1053,2442,1491],{"class":1128},[1053,2444,2446],{"class":1055,"line":2445},58,[1053,2447,1104],{"emptyLinePlaceholder":1103},[1053,2449,2451],{"class":1055,"line":2450},59,[1053,2452,2453],{"class":1059},"# Hooks for custom behavior\n",[1053,2455,2457,2459,2462,2464,2468],{"class":1055,"line":2456},60,[1053,2458,1937],{"class":1936},[1053,2460,2461],{"class":1940}," on_starting",[1053,2463,1125],{"class":1083},[1053,2465,2467],{"class":2466},"sCyAa","server",[1053,2469,2470],{"class":1083},"):\n",[1053,2472,2474,2477,2479,2482,2484,2486,2488,2490,2493,2495],{"class":1055,"line":2473},61,[1053,2475,2476],{"class":1070},"    server",[1053,2478,1084],{"class":1083},[1053,2480,2481],{"class":1115},"log",[1053,2483,1084],{"class":1083},[1053,2485,1669],{"class":1121},[1053,2487,1125],{"class":1083},[1053,2489,1345],{"class":1128},[1053,2491,2492],{"class":1132},"Server is starting",[1053,2494,1345],{"class":1128},[1053,2496,1149],{"class":1083},[1053,2498,2500],{"class":1055,"line":2499},62,[1053,2501,1104],{"emptyLinePlaceholder":1103},[1053,2503,2505,2507,2510,2512,2514],{"class":1055,"line":2504},63,[1053,2506,1937],{"class":1936},[1053,2508,2509],{"class":1940}," on_reload",[1053,2511,1125],{"class":1083},[1053,2513,2467],{"class":2466},[1053,2515,2470],{"class":1083},[1053,2517,2519,2521,2523,2525,2527,2529,2531,2533,2536,2538],{"class":1055,"line":2518},64,[1053,2520,2476],{"class":1070},[1053,2522,1084],{"class":1083},[1053,2524,2481],{"class":1115},[1053,2526,1084],{"class":1083},[1053,2528,1669],{"class":1121},[1053,2530,1125],{"class":1083},[1053,2532,1345],{"class":1128},[1053,2534,2535],{"class":1132},"Server is reloading",[1053,2537,1345],{"class":1128},[1053,2539,1149],{"class":1083},[1053,2541,2543],{"class":1055,"line":2542},65,[1053,2544,1104],{"emptyLinePlaceholder":1103},[1053,2546,2548,2550,2553,2555,2558],{"class":1055,"line":2547},66,[1053,2549,1937],{"class":1936},[1053,2551,2552],{"class":1940}," worker_int",[1053,2554,1125],{"class":1083},[1053,2556,2557],{"class":2466},"worker",[1053,2559,2470],{"class":1083},[1053,2561,2563,2566,2568,2570,2572,2574,2576,2578,2581,2583],{"class":1055,"line":2562},67,[1053,2564,2565],{"class":1070},"    worker",[1053,2567,1084],{"class":1083},[1053,2569,2481],{"class":1115},[1053,2571,1084],{"class":1083},[1053,2573,1669],{"class":1121},[1053,2575,1125],{"class":1083},[1053,2577,1345],{"class":1128},[1053,2579,2580],{"class":1132},"Worker received INT or QUIT signal",[1053,2582,1345],{"class":1128},[1053,2584,1149],{"class":1083},[1053,2586,2588],{"class":1055,"line":2587},68,[1053,2589,1104],{"emptyLinePlaceholder":1103},[1053,2591,2593,2595,2598,2600,2602,2604,2607],{"class":1055,"line":2592},69,[1053,2594,1937],{"class":1936},[1053,2596,2597],{"class":1940}," pre_fork",[1053,2599,1125],{"class":1083},[1053,2601,2467],{"class":2466},[1053,2603,1138],{"class":1083},[1053,2605,2606],{"class":2466}," worker",[1053,2608,2470],{"class":1083},[1053,2610,2612,2614,2616,2618,2620,2622,2624,2626,2629,2632,2634,2636,2638,2640,2642,2645],{"class":1055,"line":2611},70,[1053,2613,2476],{"class":1070},[1053,2615,1084],{"class":1083},[1053,2617,2481],{"class":1115},[1053,2619,1084],{"class":1083},[1053,2621,1669],{"class":1121},[1053,2623,1125],{"class":1083},[1053,2625,1345],{"class":1128},[1053,2627,2628],{"class":1132},"Worker spawned (pid: ",[1053,2630,2631],{"class":1684},"%s",[1053,2633,1993],{"class":1132},[1053,2635,1345],{"class":1128},[1053,2637,1138],{"class":1083},[1053,2639,2606],{"class":1121},[1053,2641,1084],{"class":1083},[1053,2643,2644],{"class":1115},"pid",[1053,2646,1149],{"class":1083},[1053,2648,2650],{"class":1055,"line":2649},71,[1053,2651,1104],{"emptyLinePlaceholder":1103},[1053,2653,2655,2657,2660,2662,2664,2666,2668],{"class":1055,"line":2654},72,[1053,2656,1937],{"class":1936},[1053,2658,2659],{"class":1940}," post_fork",[1053,2661,1125],{"class":1083},[1053,2663,2467],{"class":2466},[1053,2665,1138],{"class":1083},[1053,2667,2606],{"class":2466},[1053,2669,2470],{"class":1083},[1053,2671,2673,2675,2677,2679,2681,2683,2685,2687,2689,2691,2693,2695,2697,2699,2701,2703],{"class":1055,"line":2672},73,[1053,2674,2476],{"class":1070},[1053,2676,1084],{"class":1083},[1053,2678,2481],{"class":1115},[1053,2680,1084],{"class":1083},[1053,2682,1669],{"class":1121},[1053,2684,1125],{"class":1083},[1053,2686,1345],{"class":1128},[1053,2688,2628],{"class":1132},[1053,2690,2631],{"class":1684},[1053,2692,1993],{"class":1132},[1053,2694,1345],{"class":1128},[1053,2696,1138],{"class":1083},[1053,2698,2606],{"class":1121},[1053,2700,1084],{"class":1083},[1053,2702,2644],{"class":1115},[1053,2704,1149],{"class":1083},[1053,2706,2708],{"class":1055,"line":2707},74,[1053,2709,2710],{"class":1059},"    # Initialize worker-specific resources here\n",[1053,2712,2714],{"class":1055,"line":2713},75,[1053,2715,1104],{"emptyLinePlaceholder":1103},[1053,2717,2719,2721,2724,2726,2728],{"class":1055,"line":2718},76,[1053,2720,1937],{"class":1936},[1053,2722,2723],{"class":1940}," worker_abort",[1053,2725,1125],{"class":1083},[1053,2727,2557],{"class":2466},[1053,2729,2470],{"class":1083},[1053,2731,2733,2735,2737,2739,2741,2743,2745,2747,2750,2752],{"class":1055,"line":2732},77,[1053,2734,2565],{"class":1070},[1053,2736,1084],{"class":1083},[1053,2738,2481],{"class":1115},[1053,2740,1084],{"class":1083},[1053,2742,1669],{"class":1121},[1053,2744,1125],{"class":1083},[1053,2746,1345],{"class":1128},[1053,2748,2749],{"class":1132},"Worker received SIGABRT signal",[1053,2751,1345],{"class":1128},[1053,2753,1149],{"class":1083},[1035,2755,2757],{"id":2756},"systemd-service-for-gunicorn","Systemd Service for Gunicorn",[1043,2759,2763],{"className":2760,"code":2761,"language":2762,"meta":1048,"style":1048},"language-ini shiki shiki-themes material-theme-lighter vitesse-light vitesse-dark","# /etc/systemd/system/django-app.service\n[Unit]\nDescription=Django App Gunicorn daemon\nRequires=django-app.socket\nAfter=network.target\n\n[Service]\nType=notify\nUser=django\nGroup=django\nRuntimeDirectory=gunicorn\nWorkingDirectory=/opt/django_app\nExecStart=/opt/django_app/venv/bin/gunicorn \\\n    --config /opt/django_app/gunicorn.conf.py \\\n    --pid /run/gunicorn/django_app.pid \\\n    myproject.wsgi:application\nExecReload=/bin/kill -s HUP $MAINPID\nKillMode=mixed\nTimeoutStopSec=5\nPrivateTmp=true\nRestart=on-failure\nRestartSec=5\n\n# Environment\nEnvironment=DJANGO_SETTINGS_MODULE=myproject.settings.production\nEnvironmentFile=/opt/django_app/.env\n\n# Security\nNoNewPrivileges=yes\nProtectSystem=strict\nProtectHome=yes\nReadWritePaths=/opt/django_app /var/log/gunicorn /run/gunicorn\n\n[Install]\nWantedBy=multi-user.target\n","ini",[1050,2764,2765,2770,2775,2780,2785,2790,2794,2799,2804,2809,2814,2819,2824,2829,2834,2839,2844,2849,2854,2859,2864,2869,2874,2878,2883,2888,2893,2897,2901,2906,2911,2916,2921,2925,2930],{"__ignoreMap":1048},[1053,2766,2767],{"class":1055,"line":1056},[1053,2768,2769],{},"# /etc/systemd/system/django-app.service\n",[1053,2771,2772],{"class":1055,"line":1063},[1053,2773,2774],{},"[Unit]\n",[1053,2776,2777],{"class":1055,"line":1074},[1053,2778,2779],{},"Description=Django App Gunicorn daemon\n",[1053,2781,2782],{"class":1055,"line":1100},[1053,2783,2784],{},"Requires=django-app.socket\n",[1053,2786,2787],{"class":1055,"line":1107},[1053,2788,2789],{},"After=network.target\n",[1053,2791,2792],{"class":1055,"line":1152},[1053,2793,1104],{"emptyLinePlaceholder":1103},[1053,2795,2796],{"class":1055,"line":1283},[1053,2797,2798],{},"[Service]\n",[1053,2800,2801],{"class":1055,"line":1288},[1053,2802,2803],{},"Type=notify\n",[1053,2805,2806],{"class":1055,"line":1319},[1053,2807,2808],{},"User=django\n",[1053,2810,2811],{"class":1055,"line":1324},[1053,2812,2813],{},"Group=django\n",[1053,2815,2816],{"class":1055,"line":1336},[1053,2817,2818],{},"RuntimeDirectory=gunicorn\n",[1053,2820,2821],{"class":1055,"line":1356},[1053,2822,2823],{},"WorkingDirectory=/opt/django_app\n",[1053,2825,2826],{"class":1055,"line":1374},[1053,2827,2828],{},"ExecStart=/opt/django_app/venv/bin/gunicorn \\\n",[1053,2830,2831],{"class":1055,"line":1382},[1053,2832,2833],{},"    --config /opt/django_app/gunicorn.conf.py \\\n",[1053,2835,2836],{"class":1055,"line":1398},[1053,2837,2838],{},"    --pid /run/gunicorn/django_app.pid \\\n",[1053,2840,2841],{"class":1055,"line":1404},[1053,2842,2843],{},"    myproject.wsgi:application\n",[1053,2845,2846],{"class":1055,"line":1410},[1053,2847,2848],{},"ExecReload=/bin/kill -s HUP $MAINPID\n",[1053,2850,2851],{"class":1055,"line":1607},[1053,2852,2853],{},"KillMode=mixed\n",[1053,2855,2856],{"class":1055,"line":1618},[1053,2857,2858],{},"TimeoutStopSec=5\n",[1053,2860,2861],{"class":1055,"line":1623},[1053,2862,2863],{},"PrivateTmp=true\n",[1053,2865,2866],{"class":1055,"line":1629},[1053,2867,2868],{},"Restart=on-failure\n",[1053,2870,2871],{"class":1055,"line":1644},[1053,2872,2873],{},"RestartSec=5\n",[1053,2875,2876],{"class":1055,"line":1659},[1053,2877,1104],{"emptyLinePlaceholder":1103},[1053,2879,2880],{"class":1055,"line":1674},[1053,2881,2882],{},"# Environment\n",[1053,2884,2885],{"class":1055,"line":1730},[1053,2886,2887],{},"Environment=DJANGO_SETTINGS_MODULE=myproject.settings.production\n",[1053,2889,2890],{"class":1055,"line":1735},[1053,2891,2892],{},"EnvironmentFile=/opt/django_app/.env\n",[1053,2894,2895],{"class":1055,"line":1741},[1053,2896,1104],{"emptyLinePlaceholder":1103},[1053,2898,2899],{"class":1055,"line":1756},[1053,2900,2366],{},[1053,2902,2903],{"class":1055,"line":1761},[1053,2904,2905],{},"NoNewPrivileges=yes\n",[1053,2907,2908],{"class":1055,"line":1767},[1053,2909,2910],{},"ProtectSystem=strict\n",[1053,2912,2913],{"class":1055,"line":1779},[1053,2914,2915],{},"ProtectHome=yes\n",[1053,2917,2918],{"class":1055,"line":1794},[1053,2919,2920],{},"ReadWritePaths=/opt/django_app /var/log/gunicorn /run/gunicorn\n",[1053,2922,2923],{"class":1055,"line":1809},[1053,2924,1104],{"emptyLinePlaceholder":1103},[1053,2926,2927],{"class":1055,"line":1823},[1053,2928,2929],{},"[Install]\n",[1053,2931,2932],{"class":1055,"line":1834},[1053,2933,2934],{},"WantedBy=multi-user.target\n",[1043,2936,2938],{"className":2760,"code":2937,"language":2762,"meta":1048,"style":1048},"# /etc/systemd/system/django-app.socket\n[Unit]\nDescription=Django App Gunicorn socket\n\n[Socket]\nListenStream=/run/gunicorn/django_app.sock\nSocketUser=www-data\nSocketMode=600\n\n[Install]\nWantedBy=sockets.target\n",[1050,2939,2940,2945,2949,2954,2958,2963,2968,2973,2978,2982,2986],{"__ignoreMap":1048},[1053,2941,2942],{"class":1055,"line":1056},[1053,2943,2944],{},"# /etc/systemd/system/django-app.socket\n",[1053,2946,2947],{"class":1055,"line":1063},[1053,2948,2774],{},[1053,2950,2951],{"class":1055,"line":1074},[1053,2952,2953],{},"Description=Django App Gunicorn socket\n",[1053,2955,2956],{"class":1055,"line":1100},[1053,2957,1104],{"emptyLinePlaceholder":1103},[1053,2959,2960],{"class":1055,"line":1107},[1053,2961,2962],{},"[Socket]\n",[1053,2964,2965],{"class":1055,"line":1152},[1053,2966,2967],{},"ListenStream=/run/gunicorn/django_app.sock\n",[1053,2969,2970],{"class":1055,"line":1283},[1053,2971,2972],{},"SocketUser=www-data\n",[1053,2974,2975],{"class":1055,"line":1288},[1053,2976,2977],{},"SocketMode=600\n",[1053,2979,2980],{"class":1055,"line":1319},[1053,2981,1104],{"emptyLinePlaceholder":1103},[1053,2983,2984],{"class":1055,"line":1324},[1053,2985,2929],{},[1053,2987,2988],{"class":1055,"line":1336},[1053,2989,2990],{},"WantedBy=sockets.target\n",[1030,2992,2994],{"id":2993},"uwsgi-wsgi-server","uWSGI (WSGI Server)",[1026,2996,2997],{},"uWSGI is a powerful application server with extensive configuration options and built-in features.",[1035,2999,3001],{"id":3000},"uwsgi-configuration","uWSGI Configuration",[1043,3003,3005],{"className":2760,"code":3004,"language":2762,"meta":1048,"style":1048},"# uwsgi.ini\n[uwsgi]\n# Application settings\nmodule = myproject.wsgi:application\npythonpath = /opt/django_app\nchdir = /opt/django_app\nvirtualenv = /opt/django_app/venv\n\n# Server settings\nhttp = :8000\nsocket = /run/uwsgi/django_app.sock\nchmod-socket = 666\nvacuum = true\ndie-on-term = true\n\n# Process management\nmaster = true\nprocesses = 4\nthreads = 2\nenable-threads = true\nthunder-lock = true\n\n# Memory management\nmax-requests = 1000\nmax-requests-delta = 100\nreload-on-rss = 512\nevil-reload-on-rss = 1024\n\n# Logging\nlogto = /var/log/uwsgi/django_app.log\nlog-maxsize = 50000000\nlog-backupname = /var/log/uwsgi/django_app.log.old\nlogformat = %(addr) - %(user) [%(ltime)] \"%(method) %(uri) %(proto)\" %(status) %(size) \"%(referer)\" \"%(uagent)\" %(msecs)ms\n\n# Security\nuid = django\ngid = django\numask = 002\n\n# Performance\nbuffer-size = 32768\npost-buffering = 8192\nharakiri = 60\nharakiri-verbose = true\nreload-mercy = 8\n\n# Static files (if not using separate web server)\nstatic-map = /static=/opt/django_app/staticfiles\nstatic-expires-uri = /static/.*\\.(css|js|png|jpg|jpeg|gif|ico|woff|ttf) 7776000\n\n# Health checks\nstats = 127.0.0.1:9191\nstats-http = true\n\n# Environment\nenv = DJANGO_SETTINGS_MODULE=myproject.settings.production\nfor-readline = /opt/django_app/.env\n  env = %(_)\nendfor =\n",[1050,3006,3007,3012,3017,3022,3027,3032,3037,3042,3046,3051,3056,3061,3066,3071,3076,3080,3085,3090,3095,3100,3105,3110,3114,3118,3123,3128,3133,3138,3142,3146,3151,3156,3161,3166,3170,3174,3179,3184,3189,3193,3198,3203,3208,3213,3218,3223,3227,3232,3237,3242,3246,3251,3256,3261,3265,3269,3274,3279,3284],{"__ignoreMap":1048},[1053,3008,3009],{"class":1055,"line":1056},[1053,3010,3011],{},"# uwsgi.ini\n",[1053,3013,3014],{"class":1055,"line":1063},[1053,3015,3016],{},"[uwsgi]\n",[1053,3018,3019],{"class":1055,"line":1074},[1053,3020,3021],{},"# Application settings\n",[1053,3023,3024],{"class":1055,"line":1100},[1053,3025,3026],{},"module = myproject.wsgi:application\n",[1053,3028,3029],{"class":1055,"line":1107},[1053,3030,3031],{},"pythonpath = /opt/django_app\n",[1053,3033,3034],{"class":1055,"line":1152},[1053,3035,3036],{},"chdir = /opt/django_app\n",[1053,3038,3039],{"class":1055,"line":1283},[1053,3040,3041],{},"virtualenv = /opt/django_app/venv\n",[1053,3043,3044],{"class":1055,"line":1288},[1053,3045,1104],{"emptyLinePlaceholder":1103},[1053,3047,3048],{"class":1055,"line":1319},[1053,3049,3050],{},"# Server settings\n",[1053,3052,3053],{"class":1055,"line":1324},[1053,3054,3055],{},"http = :8000\n",[1053,3057,3058],{"class":1055,"line":1336},[1053,3059,3060],{},"socket = /run/uwsgi/django_app.sock\n",[1053,3062,3063],{"class":1055,"line":1356},[1053,3064,3065],{},"chmod-socket = 666\n",[1053,3067,3068],{"class":1055,"line":1374},[1053,3069,3070],{},"vacuum = true\n",[1053,3072,3073],{"class":1055,"line":1382},[1053,3074,3075],{},"die-on-term = true\n",[1053,3077,3078],{"class":1055,"line":1398},[1053,3079,1104],{"emptyLinePlaceholder":1103},[1053,3081,3082],{"class":1055,"line":1404},[1053,3083,3084],{},"# Process management\n",[1053,3086,3087],{"class":1055,"line":1410},[1053,3088,3089],{},"master = true\n",[1053,3091,3092],{"class":1055,"line":1607},[1053,3093,3094],{},"processes = 4\n",[1053,3096,3097],{"class":1055,"line":1618},[1053,3098,3099],{},"threads = 2\n",[1053,3101,3102],{"class":1055,"line":1623},[1053,3103,3104],{},"enable-threads = true\n",[1053,3106,3107],{"class":1055,"line":1629},[1053,3108,3109],{},"thunder-lock = true\n",[1053,3111,3112],{"class":1055,"line":1644},[1053,3113,1104],{"emptyLinePlaceholder":1103},[1053,3115,3116],{"class":1055,"line":1659},[1053,3117,2170],{},[1053,3119,3120],{"class":1055,"line":1674},[1053,3121,3122],{},"max-requests = 1000\n",[1053,3124,3125],{"class":1055,"line":1730},[1053,3126,3127],{},"max-requests-delta = 100\n",[1053,3129,3130],{"class":1055,"line":1735},[1053,3131,3132],{},"reload-on-rss = 512\n",[1053,3134,3135],{"class":1055,"line":1741},[1053,3136,3137],{},"evil-reload-on-rss = 1024\n",[1053,3139,3140],{"class":1055,"line":1756},[1053,3141,1104],{"emptyLinePlaceholder":1103},[1053,3143,3144],{"class":1055,"line":1761},[1053,3145,1626],{},[1053,3147,3148],{"class":1055,"line":1767},[1053,3149,3150],{},"logto = /var/log/uwsgi/django_app.log\n",[1053,3152,3153],{"class":1055,"line":1779},[1053,3154,3155],{},"log-maxsize = 50000000\n",[1053,3157,3158],{"class":1055,"line":1794},[1053,3159,3160],{},"log-backupname = /var/log/uwsgi/django_app.log.old\n",[1053,3162,3163],{"class":1055,"line":1809},[1053,3164,3165],{},"logformat = %(addr) - %(user) [%(ltime)] \"%(method) %(uri) %(proto)\" %(status) %(size) \"%(referer)\" \"%(uagent)\" %(msecs)ms\n",[1053,3167,3168],{"class":1055,"line":1823},[1053,3169,1104],{"emptyLinePlaceholder":1103},[1053,3171,3172],{"class":1055,"line":1834},[1053,3173,2366],{},[1053,3175,3176],{"class":1055,"line":1839},[1053,3177,3178],{},"uid = django\n",[1053,3180,3181],{"class":1055,"line":1845},[1053,3182,3183],{},"gid = django\n",[1053,3185,3186],{"class":1055,"line":1851},[1053,3187,3188],{},"umask = 002\n",[1053,3190,3191],{"class":1055,"line":1857},[1053,3192,1104],{"emptyLinePlaceholder":1103},[1053,3194,3195],{"class":1055,"line":1862},[1053,3196,3197],{},"# Performance\n",[1053,3199,3200],{"class":1055,"line":1868},[1053,3201,3202],{},"buffer-size = 32768\n",[1053,3204,3205],{"class":1055,"line":1879},[1053,3206,3207],{},"post-buffering = 8192\n",[1053,3209,3210],{"class":1055,"line":1893},[1053,3211,3212],{},"harakiri = 60\n",[1053,3214,3215],{"class":1055,"line":2289},[1053,3216,3217],{},"harakiri-verbose = true\n",[1053,3219,3220],{"class":1055,"line":2295},[1053,3221,3222],{},"reload-mercy = 8\n",[1053,3224,3225],{"class":1055,"line":2305},[1053,3226,1104],{"emptyLinePlaceholder":1103},[1053,3228,3229],{"class":1055,"line":2331},[1053,3230,3231],{},"# Static files (if not using separate web server)\n",[1053,3233,3234],{"class":1055,"line":2353},[1053,3235,3236],{},"static-map = /static=/opt/django_app/staticfiles\n",[1053,3238,3239],{"class":1055,"line":2358},[1053,3240,3241],{},"static-expires-uri = /static/.*\\.(css|js|png|jpg|jpeg|gif|ico|woff|ttf) 7776000\n",[1053,3243,3244],{"class":1055,"line":2363},[1053,3245,1104],{"emptyLinePlaceholder":1103},[1053,3247,3248],{"class":1055,"line":2369},[1053,3249,3250],{},"# Health checks\n",[1053,3252,3253],{"class":1055,"line":2380},[1053,3254,3255],{},"stats = 127.0.0.1:9191\n",[1053,3257,3258],{"class":1055,"line":2390},[1053,3259,3260],{},"stats-http = true\n",[1053,3262,3263],{"class":1055,"line":2401},[1053,3264,1104],{"emptyLinePlaceholder":1103},[1053,3266,3267],{"class":1055,"line":2406},[1053,3268,2882],{},[1053,3270,3271],{"class":1055,"line":2412},[1053,3272,3273],{},"env = DJANGO_SETTINGS_MODULE=myproject.settings.production\n",[1053,3275,3276],{"class":1055,"line":2430},[1053,3277,3278],{},"for-readline = /opt/django_app/.env\n",[1053,3280,3281],{"class":1055,"line":2445},[1053,3282,3283],{},"  env = %(_)\n",[1053,3285,3286],{"class":1055,"line":2450},[1053,3287,3288],{},"endfor =\n",[1035,3290,3292],{"id":3291},"advanced-uwsgi-configuration","Advanced uWSGI Configuration",[1043,3294,3296],{"className":2760,"code":3295,"language":2762,"meta":1048,"style":1048},"# uwsgi_advanced.ini\n[uwsgi]\n# Application\nmodule = myproject.wsgi:application\npythonpath = /opt/django_app\nchdir = /opt/django_app\nvirtualenv = /opt/django_app/venv\n\n# Networking\nhttp = :8000\nsocket = /run/uwsgi/django_app.sock\nchmod-socket = 664\nvacuum = true\ndie-on-term = true\n\n# Process management\nmaster = true\nprocesses = %(%k * 2)  # CPU count * 2\nthreads = 4\nenable-threads = true\nthread-stacksize = 512\nthunder-lock = true\nsingle-interpreter = true\n\n# Memory optimization\nmemory-report = true\nmax-requests = 1000\nmax-requests-delta = 100\nreload-on-rss = 512\nevil-reload-on-rss = 1024\nreload-on-exception = true\n\n# Caching\ncache2 = name=mycache,items=1000,keysize=64,blocksize=1024\ncache2 = name=sessions,items=10000,keysize=128,blocksize=2048\n\n# Logging\nlogto = /var/log/uwsgi/django_app.log\nlog-maxsize = 50000000\nlog-backupname = /var/log/uwsgi/django_app.log.old\nlog-reopen = true\nlogformat = %(addr) - %(user) [%(ltime)] \"%(method) %(uri) %(proto)\" %(status) %(size) \"%(referer)\" \"%(uagent)\" %(msecs)ms\n\n# Monitoring\nstats = /run/uwsgi/stats.sock\nstats-http = true\nmemory-report = true\ncarbon = 127.0.0.1:2003\n\n# Security\nuid = django\ngid = django\numask = 002\ncap = setgid,setuid\n\n# Performance tuning\nbuffer-size = 65536\npost-buffering = 8192\nharakiri = 120\nharakiri-verbose = true\nreload-mercy = 8\nworker-reload-mercy = 8\n\n# Offloading\noffload-threads = 4\nfile-serve-mode = x-accel-redirect\n\n# Spooler for background tasks\nspooler = /opt/django_app/spooler\nspooler-processes = 2\nspooler-frequency = 30\n\n# Cheaper subsystem for dynamic scaling\ncheaper-algo = busyness\ncheaper = 2\ncheaper-initial = 2\ncheaper-step = 1\ncheaper-overload = 30\n",[1050,3297,3298,3303,3307,3312,3316,3320,3324,3328,3332,3337,3341,3345,3350,3354,3358,3362,3366,3370,3375,3380,3384,3389,3393,3398,3402,3407,3412,3416,3420,3424,3428,3433,3437,3442,3447,3452,3456,3460,3464,3468,3472,3477,3481,3485,3490,3495,3499,3503,3508,3512,3516,3520,3524,3528,3533,3537,3541,3546,3550,3555,3559,3563,3568,3572,3577,3582,3587,3591,3596,3601,3606,3611,3615,3620,3625,3630,3635,3640],{"__ignoreMap":1048},[1053,3299,3300],{"class":1055,"line":1056},[1053,3301,3302],{},"# uwsgi_advanced.ini\n",[1053,3304,3305],{"class":1055,"line":1063},[1053,3306,3016],{},[1053,3308,3309],{"class":1055,"line":1074},[1053,3310,3311],{},"# Application\n",[1053,3313,3314],{"class":1055,"line":1100},[1053,3315,3026],{},[1053,3317,3318],{"class":1055,"line":1107},[1053,3319,3031],{},[1053,3321,3322],{"class":1055,"line":1152},[1053,3323,3036],{},[1053,3325,3326],{"class":1055,"line":1283},[1053,3327,3041],{},[1053,3329,3330],{"class":1055,"line":1288},[1053,3331,1104],{"emptyLinePlaceholder":1103},[1053,3333,3334],{"class":1055,"line":1319},[1053,3335,3336],{},"# Networking\n",[1053,3338,3339],{"class":1055,"line":1324},[1053,3340,3055],{},[1053,3342,3343],{"class":1055,"line":1336},[1053,3344,3060],{},[1053,3346,3347],{"class":1055,"line":1356},[1053,3348,3349],{},"chmod-socket = 664\n",[1053,3351,3352],{"class":1055,"line":1374},[1053,3353,3070],{},[1053,3355,3356],{"class":1055,"line":1382},[1053,3357,3075],{},[1053,3359,3360],{"class":1055,"line":1398},[1053,3361,1104],{"emptyLinePlaceholder":1103},[1053,3363,3364],{"class":1055,"line":1404},[1053,3365,3084],{},[1053,3367,3368],{"class":1055,"line":1410},[1053,3369,3089],{},[1053,3371,3372],{"class":1055,"line":1607},[1053,3373,3374],{},"processes = %(%k * 2)  # CPU count * 2\n",[1053,3376,3377],{"class":1055,"line":1618},[1053,3378,3379],{},"threads = 4\n",[1053,3381,3382],{"class":1055,"line":1623},[1053,3383,3104],{},[1053,3385,3386],{"class":1055,"line":1629},[1053,3387,3388],{},"thread-stacksize = 512\n",[1053,3390,3391],{"class":1055,"line":1644},[1053,3392,3109],{},[1053,3394,3395],{"class":1055,"line":1659},[1053,3396,3397],{},"single-interpreter = true\n",[1053,3399,3400],{"class":1055,"line":1674},[1053,3401,1104],{"emptyLinePlaceholder":1103},[1053,3403,3404],{"class":1055,"line":1730},[1053,3405,3406],{},"# Memory optimization\n",[1053,3408,3409],{"class":1055,"line":1735},[1053,3410,3411],{},"memory-report = true\n",[1053,3413,3414],{"class":1055,"line":1741},[1053,3415,3122],{},[1053,3417,3418],{"class":1055,"line":1756},[1053,3419,3127],{},[1053,3421,3422],{"class":1055,"line":1761},[1053,3423,3132],{},[1053,3425,3426],{"class":1055,"line":1767},[1053,3427,3137],{},[1053,3429,3430],{"class":1055,"line":1779},[1053,3431,3432],{},"reload-on-exception = true\n",[1053,3434,3435],{"class":1055,"line":1794},[1053,3436,1104],{"emptyLinePlaceholder":1103},[1053,3438,3439],{"class":1055,"line":1809},[1053,3440,3441],{},"# Caching\n",[1053,3443,3444],{"class":1055,"line":1823},[1053,3445,3446],{},"cache2 = name=mycache,items=1000,keysize=64,blocksize=1024\n",[1053,3448,3449],{"class":1055,"line":1834},[1053,3450,3451],{},"cache2 = name=sessions,items=10000,keysize=128,blocksize=2048\n",[1053,3453,3454],{"class":1055,"line":1839},[1053,3455,1104],{"emptyLinePlaceholder":1103},[1053,3457,3458],{"class":1055,"line":1845},[1053,3459,1626],{},[1053,3461,3462],{"class":1055,"line":1851},[1053,3463,3150],{},[1053,3465,3466],{"class":1055,"line":1857},[1053,3467,3155],{},[1053,3469,3470],{"class":1055,"line":1862},[1053,3471,3160],{},[1053,3473,3474],{"class":1055,"line":1868},[1053,3475,3476],{},"log-reopen = true\n",[1053,3478,3479],{"class":1055,"line":1879},[1053,3480,3165],{},[1053,3482,3483],{"class":1055,"line":1893},[1053,3484,1104],{"emptyLinePlaceholder":1103},[1053,3486,3487],{"class":1055,"line":2289},[1053,3488,3489],{},"# Monitoring\n",[1053,3491,3492],{"class":1055,"line":2295},[1053,3493,3494],{},"stats = /run/uwsgi/stats.sock\n",[1053,3496,3497],{"class":1055,"line":2305},[1053,3498,3260],{},[1053,3500,3501],{"class":1055,"line":2331},[1053,3502,3411],{},[1053,3504,3505],{"class":1055,"line":2353},[1053,3506,3507],{},"carbon = 127.0.0.1:2003\n",[1053,3509,3510],{"class":1055,"line":2358},[1053,3511,1104],{"emptyLinePlaceholder":1103},[1053,3513,3514],{"class":1055,"line":2363},[1053,3515,2366],{},[1053,3517,3518],{"class":1055,"line":2369},[1053,3519,3178],{},[1053,3521,3522],{"class":1055,"line":2380},[1053,3523,3183],{},[1053,3525,3526],{"class":1055,"line":2390},[1053,3527,3188],{},[1053,3529,3530],{"class":1055,"line":2401},[1053,3531,3532],{},"cap = setgid,setuid\n",[1053,3534,3535],{"class":1055,"line":2406},[1053,3536,1104],{"emptyLinePlaceholder":1103},[1053,3538,3539],{"class":1055,"line":2412},[1053,3540,2409],{},[1053,3542,3543],{"class":1055,"line":2430},[1053,3544,3545],{},"buffer-size = 65536\n",[1053,3547,3548],{"class":1055,"line":2445},[1053,3549,3207],{},[1053,3551,3552],{"class":1055,"line":2450},[1053,3553,3554],{},"harakiri = 120\n",[1053,3556,3557],{"class":1055,"line":2456},[1053,3558,3217],{},[1053,3560,3561],{"class":1055,"line":2473},[1053,3562,3222],{},[1053,3564,3565],{"class":1055,"line":2499},[1053,3566,3567],{},"worker-reload-mercy = 8\n",[1053,3569,3570],{"class":1055,"line":2504},[1053,3571,1104],{"emptyLinePlaceholder":1103},[1053,3573,3574],{"class":1055,"line":2518},[1053,3575,3576],{},"# Offloading\n",[1053,3578,3579],{"class":1055,"line":2542},[1053,3580,3581],{},"offload-threads = 4\n",[1053,3583,3584],{"class":1055,"line":2547},[1053,3585,3586],{},"file-serve-mode = x-accel-redirect\n",[1053,3588,3589],{"class":1055,"line":2562},[1053,3590,1104],{"emptyLinePlaceholder":1103},[1053,3592,3593],{"class":1055,"line":2587},[1053,3594,3595],{},"# Spooler for background tasks\n",[1053,3597,3598],{"class":1055,"line":2592},[1053,3599,3600],{},"spooler = /opt/django_app/spooler\n",[1053,3602,3603],{"class":1055,"line":2611},[1053,3604,3605],{},"spooler-processes = 2\n",[1053,3607,3608],{"class":1055,"line":2649},[1053,3609,3610],{},"spooler-frequency = 30\n",[1053,3612,3613],{"class":1055,"line":2654},[1053,3614,1104],{"emptyLinePlaceholder":1103},[1053,3616,3617],{"class":1055,"line":2672},[1053,3618,3619],{},"# Cheaper subsystem for dynamic scaling\n",[1053,3621,3622],{"class":1055,"line":2707},[1053,3623,3624],{},"cheaper-algo = busyness\n",[1053,3626,3627],{"class":1055,"line":2713},[1053,3628,3629],{},"cheaper = 2\n",[1053,3631,3632],{"class":1055,"line":2718},[1053,3633,3634],{},"cheaper-initial = 2\n",[1053,3636,3637],{"class":1055,"line":2732},[1053,3638,3639],{},"cheaper-step = 1\n",[1053,3641,3643],{"class":1055,"line":3642},78,[1053,3644,3645],{},"cheaper-overload = 30\n",[1030,3647,3649],{"id":3648},"uvicorn-asgi-server","Uvicorn (ASGI Server)",[1026,3651,3652],{},"Uvicorn is a lightning-fast ASGI server built on uvloop and httptools.",[1035,3654,3656],{"id":3655},"basic-uvicorn-configuration","Basic Uvicorn Configuration",[1043,3658,3660],{"className":1045,"code":3659,"language":1047,"meta":1048,"style":1048},"# uvicorn_config.py\nimport multiprocessing\n\n# Server configuration\nhost = \"0.0.0.0\"\nport = 8000\nworkers = multiprocessing.cpu_count()\n\n# ASGI application\napp = \"myproject.asgi:application\"\n\n# Logging\nlog_level = \"info\"\naccess_log = True\nlog_config = {\n    \"version\": 1,\n    \"disable_existing_loggers\": False,\n    \"formatters\": {\n        \"default\": {\n            \"format\": \"%(asctime)s - %(name)s - %(levelname)s - %(message)s\",\n        },\n        \"access\": {\n            \"format\": '%(asctime)s - %(client_addr)s - \"%(request_line)s\" %(status_code)s',\n        },\n    },\n    \"handlers\": {\n        \"default\": {\n            \"formatter\": \"default\",\n            \"class\": \"logging.StreamHandler\",\n            \"stream\": \"ext://sys.stdout\",\n        },\n        \"access\": {\n            \"formatter\": \"access\",\n            \"class\": \"logging.StreamHandler\",\n            \"stream\": \"ext://sys.stdout\",\n        },\n    },\n    \"loggers\": {\n        \"uvicorn\": {\"handlers\": [\"default\"], \"level\": \"INFO\"},\n        \"uvicorn.error\": {\"level\": \"INFO\"},\n        \"uvicorn.access\": {\"handlers\": [\"access\"], \"level\": \"INFO\", \"propagate\": False},\n    },\n}\n\n# SSL configuration (if needed)\n# ssl_keyfile = \"/path/to/keyfile.key\"\n# ssl_certfile = \"/path/to/certfile.crt\"\n\n# Performance\nloop = \"uvloop\"  # Use uvloop for better performance\nhttp = \"httptools\"  # Use httptools for HTTP parsing\nws = \"websockets\"  # WebSocket implementation\n\n# Limits\nlimit_concurrency = 1000\nlimit_max_requests = 10000\ntimeout_keep_alive = 5\n",[1050,3661,3662,3667,3673,3677,3682,3696,3706,3720,3724,3729,3743,3747,3751,3764,3773,3783,3799,3815,3828,3842,3879,3884,3897,3931,3935,3940,3953,3965,3984,4004,4024,4028,4040,4058,4076,4094,4098,4102,4115,4168,4197,4257,4261,4266,4270,4275,4280,4285,4289,4293,4310,4327,4344,4348,4353,4362,4372],{"__ignoreMap":1048},[1053,3663,3664],{"class":1055,"line":1056},[1053,3665,3666],{"class":1059},"# uvicorn_config.py\n",[1053,3668,3669,3671],{"class":1055,"line":1063},[1053,3670,1067],{"class":1066},[1053,3672,1460],{"class":1070},[1053,3674,3675],{"class":1055,"line":1074},[1053,3676,1104],{"emptyLinePlaceholder":1103},[1053,3678,3679],{"class":1055,"line":1100},[1053,3680,3681],{"class":1059},"# Server configuration\n",[1053,3683,3684,3687,3689,3691,3694],{"class":1055,"line":1107},[1053,3685,3686],{"class":1070},"host ",[1053,3688,1158],{"class":1083},[1053,3690,1485],{"class":1128},[1053,3692,3693],{"class":1132},"0.0.0.0",[1053,3695,1491],{"class":1128},[1053,3697,3698,3701,3703],{"class":1055,"line":1152},[1053,3699,3700],{"class":1070},"port ",[1053,3702,1158],{"class":1083},[1053,3704,3705],{"class":1501}," 8000\n",[1053,3707,3708,3710,3712,3714,3716,3718],{"class":1055,"line":1283},[1053,3709,1516],{"class":1070},[1053,3711,1158],{"class":1083},[1053,3713,1521],{"class":1070},[1053,3715,1084],{"class":1083},[1053,3717,1526],{"class":1121},[1053,3719,1164],{"class":1083},[1053,3721,3722],{"class":1055,"line":1288},[1053,3723,1104],{"emptyLinePlaceholder":1103},[1053,3725,3726],{"class":1055,"line":1319},[1053,3727,3728],{"class":1059},"# ASGI application\n",[1053,3730,3731,3734,3736,3738,3741],{"class":1055,"line":1324},[1053,3732,3733],{"class":1070},"app ",[1053,3735,1158],{"class":1083},[1053,3737,1485],{"class":1128},[1053,3739,3740],{"class":1132},"myproject.asgi:application",[1053,3742,1491],{"class":1128},[1053,3744,3745],{"class":1055,"line":1336},[1053,3746,1104],{"emptyLinePlaceholder":1103},[1053,3748,3749],{"class":1055,"line":1356},[1053,3750,1626],{"class":1059},[1053,3752,3753,3756,3758,3760,3762],{"class":1055,"line":1374},[1053,3754,3755],{"class":1070},"log_level ",[1053,3757,1158],{"class":1083},[1053,3759,1485],{"class":1128},[1053,3761,1669],{"class":1132},[1053,3763,1491],{"class":1128},[1053,3765,3766,3769,3771],{"class":1055,"line":1382},[1053,3767,3768],{"class":1070},"access_log ",[1053,3770,1158],{"class":1083},[1053,3772,2273],{"class":1775},[1053,3774,3775,3778,3780],{"class":1055,"line":1398},[1053,3776,3777],{"class":1070},"log_config ",[1053,3779,1158],{"class":1083},[1053,3781,3782],{"class":1083}," {\n",[1053,3784,3785,3787,3790,3792,3794,3797],{"class":1055,"line":1404},[1053,3786,1339],{"class":1128},[1053,3788,3789],{"class":1132},"version",[1053,3791,1345],{"class":1128},[1053,3793,1171],{"class":1083},[1053,3795,3796],{"class":1501}," 1",[1053,3798,1890],{"class":1083},[1053,3800,3801,3803,3806,3808,3810,3813],{"class":1055,"line":1410},[1053,3802,1339],{"class":1128},[1053,3804,3805],{"class":1132},"disable_existing_loggers",[1053,3807,1345],{"class":1128},[1053,3809,1171],{"class":1083},[1053,3811,3812],{"class":1775}," False",[1053,3814,1890],{"class":1083},[1053,3816,3817,3819,3822,3824,3826],{"class":1055,"line":1607},[1053,3818,1339],{"class":1128},[1053,3820,3821],{"class":1132},"formatters",[1053,3823,1345],{"class":1128},[1053,3825,1171],{"class":1083},[1053,3827,3782],{"class":1083},[1053,3829,3830,3833,3836,3838,3840],{"class":1055,"line":1618},[1053,3831,3832],{"class":1128},"        \"",[1053,3834,3835],{"class":1132},"default",[1053,3837,1345],{"class":1128},[1053,3839,1171],{"class":1083},[1053,3841,3782],{"class":1083},[1053,3843,3844,3847,3850,3852,3854,3856,3859,3862,3865,3867,3870,3872,3875,3877],{"class":1055,"line":1623},[1053,3845,3846],{"class":1128},"            \"",[1053,3848,3849],{"class":1132},"format",[1053,3851,1345],{"class":1128},[1053,3853,1171],{"class":1083},[1053,3855,1485],{"class":1128},[1053,3857,3858],{"class":1684},"%(asctime)s",[1053,3860,3861],{"class":1132}," - ",[1053,3863,3864],{"class":1684},"%(name)s",[1053,3866,3861],{"class":1132},[1053,3868,3869],{"class":1684},"%(levelname)s",[1053,3871,3861],{"class":1132},[1053,3873,3874],{"class":1684},"%(message)s",[1053,3876,1345],{"class":1128},[1053,3878,1890],{"class":1083},[1053,3880,3881],{"class":1055,"line":1629},[1053,3882,3883],{"class":1083},"        },\n",[1053,3885,3886,3888,3891,3893,3895],{"class":1055,"line":1644},[1053,3887,3832],{"class":1128},[1053,3889,3890],{"class":1132},"access",[1053,3892,1345],{"class":1128},[1053,3894,1171],{"class":1083},[1053,3896,3782],{"class":1083},[1053,3898,3899,3901,3903,3905,3907,3909,3911,3913,3916,3919,3922,3924,3927,3929],{"class":1055,"line":1659},[1053,3900,3846],{"class":1128},[1053,3902,3849],{"class":1132},[1053,3904,1345],{"class":1128},[1053,3906,1171],{"class":1083},[1053,3908,1141],{"class":1128},[1053,3910,3858],{"class":1684},[1053,3912,3861],{"class":1132},[1053,3914,3915],{"class":1684},"%(client_addr)s",[1053,3917,3918],{"class":1132}," - \"",[1053,3920,3921],{"class":1684},"%(request_line)s",[1053,3923,1702],{"class":1132},[1053,3925,3926],{"class":1684},"%(status_code)s",[1053,3928,1129],{"class":1128},[1053,3930,1890],{"class":1083},[1053,3932,3933],{"class":1055,"line":1674},[1053,3934,3883],{"class":1083},[1053,3936,3937],{"class":1055,"line":1730},[1053,3938,3939],{"class":1083},"    },\n",[1053,3941,3942,3944,3947,3949,3951],{"class":1055,"line":1735},[1053,3943,1339],{"class":1128},[1053,3945,3946],{"class":1132},"handlers",[1053,3948,1345],{"class":1128},[1053,3950,1171],{"class":1083},[1053,3952,3782],{"class":1083},[1053,3954,3955,3957,3959,3961,3963],{"class":1055,"line":1741},[1053,3956,3832],{"class":1128},[1053,3958,3835],{"class":1132},[1053,3960,1345],{"class":1128},[1053,3962,1171],{"class":1083},[1053,3964,3782],{"class":1083},[1053,3966,3967,3969,3972,3974,3976,3978,3980,3982],{"class":1055,"line":1756},[1053,3968,3846],{"class":1128},[1053,3970,3971],{"class":1132},"formatter",[1053,3973,1345],{"class":1128},[1053,3975,1171],{"class":1083},[1053,3977,1485],{"class":1128},[1053,3979,3835],{"class":1132},[1053,3981,1345],{"class":1128},[1053,3983,1890],{"class":1083},[1053,3985,3986,3988,3991,3993,3995,3997,4000,4002],{"class":1055,"line":1761},[1053,3987,3846],{"class":1128},[1053,3989,3990],{"class":1132},"class",[1053,3992,1345],{"class":1128},[1053,3994,1171],{"class":1083},[1053,3996,1485],{"class":1128},[1053,3998,3999],{"class":1132},"logging.StreamHandler",[1053,4001,1345],{"class":1128},[1053,4003,1890],{"class":1083},[1053,4005,4006,4008,4011,4013,4015,4017,4020,4022],{"class":1055,"line":1767},[1053,4007,3846],{"class":1128},[1053,4009,4010],{"class":1132},"stream",[1053,4012,1345],{"class":1128},[1053,4014,1171],{"class":1083},[1053,4016,1485],{"class":1128},[1053,4018,4019],{"class":1132},"ext://sys.stdout",[1053,4021,1345],{"class":1128},[1053,4023,1890],{"class":1083},[1053,4025,4026],{"class":1055,"line":1779},[1053,4027,3883],{"class":1083},[1053,4029,4030,4032,4034,4036,4038],{"class":1055,"line":1794},[1053,4031,3832],{"class":1128},[1053,4033,3890],{"class":1132},[1053,4035,1345],{"class":1128},[1053,4037,1171],{"class":1083},[1053,4039,3782],{"class":1083},[1053,4041,4042,4044,4046,4048,4050,4052,4054,4056],{"class":1055,"line":1809},[1053,4043,3846],{"class":1128},[1053,4045,3971],{"class":1132},[1053,4047,1345],{"class":1128},[1053,4049,1171],{"class":1083},[1053,4051,1485],{"class":1128},[1053,4053,3890],{"class":1132},[1053,4055,1345],{"class":1128},[1053,4057,1890],{"class":1083},[1053,4059,4060,4062,4064,4066,4068,4070,4072,4074],{"class":1055,"line":1823},[1053,4061,3846],{"class":1128},[1053,4063,3990],{"class":1132},[1053,4065,1345],{"class":1128},[1053,4067,1171],{"class":1083},[1053,4069,1485],{"class":1128},[1053,4071,3999],{"class":1132},[1053,4073,1345],{"class":1128},[1053,4075,1890],{"class":1083},[1053,4077,4078,4080,4082,4084,4086,4088,4090,4092],{"class":1055,"line":1834},[1053,4079,3846],{"class":1128},[1053,4081,4010],{"class":1132},[1053,4083,1345],{"class":1128},[1053,4085,1171],{"class":1083},[1053,4087,1485],{"class":1128},[1053,4089,4019],{"class":1132},[1053,4091,1345],{"class":1128},[1053,4093,1890],{"class":1083},[1053,4095,4096],{"class":1055,"line":1839},[1053,4097,3883],{"class":1083},[1053,4099,4100],{"class":1055,"line":1845},[1053,4101,3939],{"class":1083},[1053,4103,4104,4106,4109,4111,4113],{"class":1055,"line":1851},[1053,4105,1339],{"class":1128},[1053,4107,4108],{"class":1132},"loggers",[1053,4110,1345],{"class":1128},[1053,4112,1171],{"class":1083},[1053,4114,3782],{"class":1083},[1053,4116,4117,4119,4122,4124,4126,4129,4131,4133,4135,4137,4140,4142,4144,4146,4149,4151,4154,4156,4158,4160,4163,4165],{"class":1055,"line":1857},[1053,4118,3832],{"class":1128},[1053,4120,4121],{"class":1132},"uvicorn",[1053,4123,1345],{"class":1128},[1053,4125,1171],{"class":1083},[1053,4127,4128],{"class":1083}," {",[1053,4130,1345],{"class":1128},[1053,4132,3946],{"class":1132},[1053,4134,1345],{"class":1128},[1053,4136,1171],{"class":1083},[1053,4138,4139],{"class":1083}," [",[1053,4141,1345],{"class":1128},[1053,4143,3835],{"class":1132},[1053,4145,1345],{"class":1128},[1053,4147,4148],{"class":1083},"],",[1053,4150,1485],{"class":1128},[1053,4152,4153],{"class":1132},"level",[1053,4155,1345],{"class":1128},[1053,4157,1171],{"class":1083},[1053,4159,1485],{"class":1128},[1053,4161,4162],{"class":1132},"INFO",[1053,4164,1345],{"class":1128},[1053,4166,4167],{"class":1083},"},\n",[1053,4169,4170,4172,4175,4177,4179,4181,4183,4185,4187,4189,4191,4193,4195],{"class":1055,"line":1862},[1053,4171,3832],{"class":1128},[1053,4173,4174],{"class":1132},"uvicorn.error",[1053,4176,1345],{"class":1128},[1053,4178,1171],{"class":1083},[1053,4180,4128],{"class":1083},[1053,4182,1345],{"class":1128},[1053,4184,4153],{"class":1132},[1053,4186,1345],{"class":1128},[1053,4188,1171],{"class":1083},[1053,4190,1485],{"class":1128},[1053,4192,4162],{"class":1132},[1053,4194,1345],{"class":1128},[1053,4196,4167],{"class":1083},[1053,4198,4199,4201,4204,4206,4208,4210,4212,4214,4216,4218,4220,4222,4224,4226,4228,4230,4232,4234,4236,4238,4240,4242,4244,4246,4249,4251,4253,4255],{"class":1055,"line":1868},[1053,4200,3832],{"class":1128},[1053,4202,4203],{"class":1132},"uvicorn.access",[1053,4205,1345],{"class":1128},[1053,4207,1171],{"class":1083},[1053,4209,4128],{"class":1083},[1053,4211,1345],{"class":1128},[1053,4213,3946],{"class":1132},[1053,4215,1345],{"class":1128},[1053,4217,1171],{"class":1083},[1053,4219,4139],{"class":1083},[1053,4221,1345],{"class":1128},[1053,4223,3890],{"class":1132},[1053,4225,1345],{"class":1128},[1053,4227,4148],{"class":1083},[1053,4229,1485],{"class":1128},[1053,4231,4153],{"class":1132},[1053,4233,1345],{"class":1128},[1053,4235,1171],{"class":1083},[1053,4237,1485],{"class":1128},[1053,4239,4162],{"class":1132},[1053,4241,1345],{"class":1128},[1053,4243,1138],{"class":1083},[1053,4245,1485],{"class":1128},[1053,4247,4248],{"class":1132},"propagate",[1053,4250,1345],{"class":1128},[1053,4252,1171],{"class":1083},[1053,4254,3812],{"class":1775},[1053,4256,4167],{"class":1083},[1053,4258,4259],{"class":1055,"line":1879},[1053,4260,3939],{"class":1083},[1053,4262,4263],{"class":1055,"line":1893},[1053,4264,4265],{"class":1083},"}\n",[1053,4267,4268],{"class":1055,"line":2289},[1053,4269,1104],{"emptyLinePlaceholder":1103},[1053,4271,4272],{"class":1055,"line":2295},[1053,4273,4274],{"class":1059},"# SSL configuration (if needed)\n",[1053,4276,4277],{"class":1055,"line":2305},[1053,4278,4279],{"class":1059},"# ssl_keyfile = \"/path/to/keyfile.key\"\n",[1053,4281,4282],{"class":1055,"line":2331},[1053,4283,4284],{"class":1059},"# ssl_certfile = \"/path/to/certfile.crt\"\n",[1053,4286,4287],{"class":1055,"line":2353},[1053,4288,1104],{"emptyLinePlaceholder":1103},[1053,4290,4291],{"class":1055,"line":2358},[1053,4292,3197],{"class":1059},[1053,4294,4295,4298,4300,4302,4305,4307],{"class":1055,"line":2363},[1053,4296,4297],{"class":1070},"loop ",[1053,4299,1158],{"class":1083},[1053,4301,1485],{"class":1128},[1053,4303,4304],{"class":1132},"uvloop",[1053,4306,1345],{"class":1128},[1053,4308,4309],{"class":1059},"  # Use uvloop for better performance\n",[1053,4311,4312,4315,4317,4319,4322,4324],{"class":1055,"line":2369},[1053,4313,4314],{"class":1070},"http ",[1053,4316,1158],{"class":1083},[1053,4318,1485],{"class":1128},[1053,4320,4321],{"class":1132},"httptools",[1053,4323,1345],{"class":1128},[1053,4325,4326],{"class":1059},"  # Use httptools for HTTP parsing\n",[1053,4328,4329,4332,4334,4336,4339,4341],{"class":1055,"line":2380},[1053,4330,4331],{"class":1070},"ws ",[1053,4333,1158],{"class":1083},[1053,4335,1485],{"class":1128},[1053,4337,4338],{"class":1132},"websockets",[1053,4340,1345],{"class":1128},[1053,4342,4343],{"class":1059},"  # WebSocket implementation\n",[1053,4345,4346],{"class":1055,"line":2390},[1053,4347,1104],{"emptyLinePlaceholder":1103},[1053,4349,4350],{"class":1055,"line":2401},[1053,4351,4352],{"class":1059},"# Limits\n",[1053,4354,4355,4358,4360],{"class":1055,"line":2406},[1053,4356,4357],{"class":1070},"limit_concurrency ",[1053,4359,1158],{"class":1083},[1053,4361,1566],{"class":1501},[1053,4363,4364,4367,4369],{"class":1055,"line":2412},[1053,4365,4366],{"class":1070},"limit_max_requests ",[1053,4368,1158],{"class":1083},[1053,4370,4371],{"class":1501}," 10000\n",[1053,4373,4374,4377,4379],{"class":1055,"line":2430},[1053,4375,4376],{"class":1070},"timeout_keep_alive ",[1053,4378,1158],{"class":1083},[1053,4380,2161],{"class":1501},[1035,4382,4384],{"id":4383},"production-uvicorn-with-gunicorn","Production Uvicorn with Gunicorn",[1043,4386,4388],{"className":1045,"code":4387,"language":1047,"meta":1048,"style":1048},"# gunicorn_uvicorn.conf.py\nimport multiprocessing\n\n# Use Uvicorn workers with Gunicorn for production\nbind = \"0.0.0.0:8000\"\nworkers = multiprocessing.cpu_count()\nworker_class = \"uvicorn.workers.UvicornWorker\"\nworker_connections = 1000\n\n# Timeouts\ntimeout = 120\nkeepalive = 5\ngraceful_timeout = 30\n\n# Logging\naccesslog = \"/var/log/gunicorn/access.log\"\nerrorlog = \"/var/log/gunicorn/error.log\"\nloglevel = \"info\"\n\n# Performance\nmax_requests = 1000\nmax_requests_jitter = 50\npreload_app = True\n\n# Process management\nproc_name = \"django_asgi_app\"\npidfile = \"/var/run/gunicorn/django_asgi.pid\"\n\n# Environment\nraw_env = [\n    \"DJANGO_SETTINGS_MODULE=myproject.settings.production\",\n]\n",[1050,4389,4390,4395,4401,4405,4410,4422,4436,4449,4457,4461,4466,4475,4483,4491,4495,4499,4511,4523,4535,4539,4543,4551,4559,4567,4571,4575,4588,4601,4605,4609,4617,4627],{"__ignoreMap":1048},[1053,4391,4392],{"class":1055,"line":1056},[1053,4393,4394],{"class":1059},"# gunicorn_uvicorn.conf.py\n",[1053,4396,4397,4399],{"class":1055,"line":1063},[1053,4398,1067],{"class":1066},[1053,4400,1460],{"class":1070},[1053,4402,4403],{"class":1055,"line":1074},[1053,4404,1104],{"emptyLinePlaceholder":1103},[1053,4406,4407],{"class":1055,"line":1100},[1053,4408,4409],{"class":1059},"# Use Uvicorn workers with Gunicorn for production\n",[1053,4411,4412,4414,4416,4418,4420],{"class":1055,"line":1107},[1053,4413,1480],{"class":1070},[1053,4415,1158],{"class":1083},[1053,4417,1485],{"class":1128},[1053,4419,1488],{"class":1132},[1053,4421,1491],{"class":1128},[1053,4423,4424,4426,4428,4430,4432,4434],{"class":1055,"line":1152},[1053,4425,1516],{"class":1070},[1053,4427,1158],{"class":1083},[1053,4429,1521],{"class":1070},[1053,4431,1084],{"class":1083},[1053,4433,1526],{"class":1121},[1053,4435,1164],{"class":1083},[1053,4437,4438,4440,4442,4444,4447],{"class":1055,"line":1283},[1053,4439,1547],{"class":1070},[1053,4441,1158],{"class":1083},[1053,4443,1485],{"class":1128},[1053,4445,4446],{"class":1132},"uvicorn.workers.UvicornWorker",[1053,4448,1491],{"class":1128},[1053,4450,4451,4453,4455],{"class":1055,"line":1288},[1053,4452,1561],{"class":1070},[1053,4454,1158],{"class":1083},[1053,4456,1566],{"class":1501},[1053,4458,4459],{"class":1055,"line":1319},[1053,4460,1104],{"emptyLinePlaceholder":1103},[1053,4462,4463],{"class":1055,"line":1324},[1053,4464,4465],{"class":1059},"# Timeouts\n",[1053,4467,4468,4470,4472],{"class":1055,"line":1336},[1053,4469,1571],{"class":1070},[1053,4471,1158],{"class":1083},[1053,4473,4474],{"class":1501}," 120\n",[1053,4476,4477,4479,4481],{"class":1055,"line":1356},[1053,4478,1581],{"class":1070},[1053,4480,1158],{"class":1083},[1053,4482,2161],{"class":1501},[1053,4484,4485,4487,4489],{"class":1055,"line":1374},[1053,4486,2214],{"class":1070},[1053,4488,1158],{"class":1083},[1053,4490,1576],{"class":1501},[1053,4492,4493],{"class":1055,"line":1382},[1053,4494,1104],{"emptyLinePlaceholder":1103},[1053,4496,4497],{"class":1055,"line":1398},[1053,4498,1626],{"class":1059},[1053,4500,4501,4503,4505,4507,4509],{"class":1055,"line":1404},[1053,4502,1632],{"class":1070},[1053,4504,1158],{"class":1083},[1053,4506,1485],{"class":1128},[1053,4508,1639],{"class":1132},[1053,4510,1491],{"class":1128},[1053,4512,4513,4515,4517,4519,4521],{"class":1055,"line":1410},[1053,4514,1647],{"class":1070},[1053,4516,1158],{"class":1083},[1053,4518,1485],{"class":1128},[1053,4520,1654],{"class":1132},[1053,4522,1491],{"class":1128},[1053,4524,4525,4527,4529,4531,4533],{"class":1055,"line":1607},[1053,4526,1662],{"class":1070},[1053,4528,1158],{"class":1083},[1053,4530,1485],{"class":1128},[1053,4532,1669],{"class":1132},[1053,4534,1491],{"class":1128},[1053,4536,4537],{"class":1055,"line":1618},[1053,4538,1104],{"emptyLinePlaceholder":1103},[1053,4540,4541],{"class":1055,"line":1623},[1053,4542,3197],{"class":1059},[1053,4544,4545,4547,4549],{"class":1055,"line":1629},[1053,4546,1600],{"class":1070},[1053,4548,1158],{"class":1083},[1053,4550,1566],{"class":1501},[1053,4552,4553,4555,4557],{"class":1055,"line":1644},[1053,4554,1610],{"class":1070},[1053,4556,1158],{"class":1083},[1053,4558,1615],{"class":1501},[1053,4560,4561,4563,4565],{"class":1055,"line":1659},[1053,4562,2192],{"class":1070},[1053,4564,1158],{"class":1083},[1053,4566,2273],{"class":1775},[1053,4568,4569],{"class":1055,"line":1674},[1053,4570,1104],{"emptyLinePlaceholder":1103},[1053,4572,4573],{"class":1055,"line":1730},[1053,4574,3084],{"class":1059},[1053,4576,4577,4579,4581,4583,4586],{"class":1055,"line":1735},[1053,4578,1744],{"class":1070},[1053,4580,1158],{"class":1083},[1053,4582,1485],{"class":1128},[1053,4584,4585],{"class":1132},"django_asgi_app",[1053,4587,1491],{"class":1128},[1053,4589,4590,4592,4594,4596,4599],{"class":1055,"line":1741},[1053,4591,1782],{"class":1070},[1053,4593,1158],{"class":1083},[1053,4595,1485],{"class":1128},[1053,4597,4598],{"class":1132},"/var/run/gunicorn/django_asgi.pid",[1053,4600,1491],{"class":1128},[1053,4602,4603],{"class":1055,"line":1756},[1053,4604,1104],{"emptyLinePlaceholder":1103},[1053,4606,4607],{"class":1055,"line":1761},[1053,4608,2882],{"class":1059},[1053,4610,4611,4613,4615],{"class":1055,"line":1767},[1053,4612,1871],{"class":1070},[1053,4614,1158],{"class":1083},[1053,4616,1876],{"class":1083},[1053,4618,4619,4621,4623,4625],{"class":1055,"line":1779},[1053,4620,1339],{"class":1128},[1053,4622,1885],{"class":1132},[1053,4624,1345],{"class":1128},[1053,4626,1890],{"class":1083},[1053,4628,4629],{"class":1055,"line":1794},[1053,4630,1896],{"class":1083},[1035,4632,4634],{"id":4633},"systemd-service-for-uvicorn","Systemd Service for Uvicorn",[1043,4636,4638],{"className":2760,"code":4637,"language":2762,"meta":1048,"style":1048},"# /etc/systemd/system/django-asgi.service\n[Unit]\nDescription=Django ASGI App\nAfter=network.target\n\n[Service]\nType=exec\nUser=django\nGroup=django\nWorkingDirectory=/opt/django_app\nExecStart=/opt/django_app/venv/bin/gunicorn \\\n    --config /opt/django_app/gunicorn_uvicorn.conf.py \\\n    myproject.asgi:application\nExecReload=/bin/kill -s HUP $MAINPID\nRestart=on-failure\nRestartSec=5\n\n# Environment\nEnvironment=DJANGO_SETTINGS_MODULE=myproject.settings.production\nEnvironmentFile=/opt/django_app/.env\n\n# Security\nNoNewPrivileges=yes\nProtectSystem=strict\nProtectHome=yes\nReadWritePaths=/opt/django_app /var/log/gunicorn\n\n[Install]\nWantedBy=multi-user.target\n",[1050,4639,4640,4645,4649,4654,4658,4662,4666,4671,4675,4679,4683,4687,4692,4697,4701,4705,4709,4713,4717,4721,4725,4729,4733,4737,4741,4745,4750,4754,4758],{"__ignoreMap":1048},[1053,4641,4642],{"class":1055,"line":1056},[1053,4643,4644],{},"# /etc/systemd/system/django-asgi.service\n",[1053,4646,4647],{"class":1055,"line":1063},[1053,4648,2774],{},[1053,4650,4651],{"class":1055,"line":1074},[1053,4652,4653],{},"Description=Django ASGI App\n",[1053,4655,4656],{"class":1055,"line":1100},[1053,4657,2789],{},[1053,4659,4660],{"class":1055,"line":1107},[1053,4661,1104],{"emptyLinePlaceholder":1103},[1053,4663,4664],{"class":1055,"line":1152},[1053,4665,2798],{},[1053,4667,4668],{"class":1055,"line":1283},[1053,4669,4670],{},"Type=exec\n",[1053,4672,4673],{"class":1055,"line":1288},[1053,4674,2808],{},[1053,4676,4677],{"class":1055,"line":1319},[1053,4678,2813],{},[1053,4680,4681],{"class":1055,"line":1324},[1053,4682,2823],{},[1053,4684,4685],{"class":1055,"line":1336},[1053,4686,2828],{},[1053,4688,4689],{"class":1055,"line":1356},[1053,4690,4691],{},"    --config /opt/django_app/gunicorn_uvicorn.conf.py \\\n",[1053,4693,4694],{"class":1055,"line":1374},[1053,4695,4696],{},"    myproject.asgi:application\n",[1053,4698,4699],{"class":1055,"line":1382},[1053,4700,2848],{},[1053,4702,4703],{"class":1055,"line":1398},[1053,4704,2868],{},[1053,4706,4707],{"class":1055,"line":1404},[1053,4708,2873],{},[1053,4710,4711],{"class":1055,"line":1410},[1053,4712,1104],{"emptyLinePlaceholder":1103},[1053,4714,4715],{"class":1055,"line":1607},[1053,4716,2882],{},[1053,4718,4719],{"class":1055,"line":1618},[1053,4720,2887],{},[1053,4722,4723],{"class":1055,"line":1623},[1053,4724,2892],{},[1053,4726,4727],{"class":1055,"line":1629},[1053,4728,1104],{"emptyLinePlaceholder":1103},[1053,4730,4731],{"class":1055,"line":1644},[1053,4732,2366],{},[1053,4734,4735],{"class":1055,"line":1659},[1053,4736,2905],{},[1053,4738,4739],{"class":1055,"line":1674},[1053,4740,2910],{},[1053,4742,4743],{"class":1055,"line":1730},[1053,4744,2915],{},[1053,4746,4747],{"class":1055,"line":1735},[1053,4748,4749],{},"ReadWritePaths=/opt/django_app /var/log/gunicorn\n",[1053,4751,4752],{"class":1055,"line":1741},[1053,4753,1104],{"emptyLinePlaceholder":1103},[1053,4755,4756],{"class":1055,"line":1756},[1053,4757,2929],{},[1053,4759,4760],{"class":1055,"line":1761},[1053,4761,2934],{},[1030,4763,4765],{"id":4764},"daphne-asgi-server","Daphne (ASGI Server)",[1026,4767,4768],{},"Daphne is the reference ASGI server developed by the Django Channels team.",[1035,4770,4772],{"id":4771},"daphne-configuration","Daphne Configuration",[1043,4774,4776],{"className":1045,"code":4775,"language":1047,"meta":1048,"style":1048},"# daphne_config.py\nimport os\n\n# Server settings\nbind = \"0.0.0.0\"\nport = 8000\nunix_socket = \"/run/daphne/django_app.sock\"\n\n# Application\napplication = \"myproject.asgi:application\"\n\n# Process settings\nverbosity = 1\naccess_log = \"/var/log/daphne/access.log\"\nping_interval = 20\nping_timeout = 30\n\n# WebSocket settings\nwebsocket_timeout = 86400  # 24 hours\nwebsocket_connect_timeout = 5\n\n# HTTP settings\nhttp_timeout = 120\nroot_path = \"\"\n\n# SSL settings (if needed)\n# ssl_keyfile = \"/path/to/keyfile.key\"\n# ssl_certfile = \"/path/to/certfile.crt\"\n\n# Proxy settings\nproxy_headers = True\nforwarded_allow_ips = [\"127.0.0.1\", \"10.0.0.0/8\"]\n",[1050,4777,4778,4783,4789,4793,4797,4809,4817,4831,4835,4839,4851,4855,4860,4869,4882,4892,4901,4905,4910,4923,4932,4936,4941,4950,4960,4964,4969,4973,4977,4981,4986,4995],{"__ignoreMap":1048},[1053,4779,4780],{"class":1055,"line":1056},[1053,4781,4782],{"class":1059},"# daphne_config.py\n",[1053,4784,4785,4787],{"class":1055,"line":1063},[1053,4786,1067],{"class":1066},[1053,4788,1071],{"class":1070},[1053,4790,4791],{"class":1055,"line":1074},[1053,4792,1104],{"emptyLinePlaceholder":1103},[1053,4794,4795],{"class":1055,"line":1100},[1053,4796,3050],{"class":1059},[1053,4798,4799,4801,4803,4805,4807],{"class":1055,"line":1107},[1053,4800,1480],{"class":1070},[1053,4802,1158],{"class":1083},[1053,4804,1485],{"class":1128},[1053,4806,3693],{"class":1132},[1053,4808,1491],{"class":1128},[1053,4810,4811,4813,4815],{"class":1055,"line":1152},[1053,4812,3700],{"class":1070},[1053,4814,1158],{"class":1083},[1053,4816,3705],{"class":1501},[1053,4818,4819,4822,4824,4826,4829],{"class":1055,"line":1283},[1053,4820,4821],{"class":1070},"unix_socket ",[1053,4823,1158],{"class":1083},[1053,4825,1485],{"class":1128},[1053,4827,4828],{"class":1132},"/run/daphne/django_app.sock",[1053,4830,1491],{"class":1128},[1053,4832,4833],{"class":1055,"line":1288},[1053,4834,1104],{"emptyLinePlaceholder":1103},[1053,4836,4837],{"class":1055,"line":1319},[1053,4838,3311],{"class":1059},[1053,4840,4841,4843,4845,4847,4849],{"class":1055,"line":1324},[1053,4842,1155],{"class":1070},[1053,4844,1158],{"class":1083},[1053,4846,1485],{"class":1128},[1053,4848,3740],{"class":1132},[1053,4850,1491],{"class":1128},[1053,4852,4853],{"class":1055,"line":1336},[1053,4854,1104],{"emptyLinePlaceholder":1103},[1053,4856,4857],{"class":1055,"line":1356},[1053,4858,4859],{"class":1059},"# Process settings\n",[1053,4861,4862,4865,4867],{"class":1055,"line":1374},[1053,4863,4864],{"class":1070},"verbosity ",[1053,4866,1158],{"class":1083},[1053,4868,1542],{"class":1501},[1053,4870,4871,4873,4875,4877,4880],{"class":1055,"line":1382},[1053,4872,3768],{"class":1070},[1053,4874,1158],{"class":1083},[1053,4876,1485],{"class":1128},[1053,4878,4879],{"class":1132},"/var/log/daphne/access.log",[1053,4881,1491],{"class":1128},[1053,4883,4884,4887,4889],{"class":1055,"line":1398},[1053,4885,4886],{"class":1070},"ping_interval ",[1053,4888,1158],{"class":1083},[1053,4890,4891],{"class":1501}," 20\n",[1053,4893,4894,4897,4899],{"class":1055,"line":1404},[1053,4895,4896],{"class":1070},"ping_timeout ",[1053,4898,1158],{"class":1083},[1053,4900,1576],{"class":1501},[1053,4902,4903],{"class":1055,"line":1410},[1053,4904,1104],{"emptyLinePlaceholder":1103},[1053,4906,4907],{"class":1055,"line":1607},[1053,4908,4909],{"class":1059},"# WebSocket settings\n",[1053,4911,4912,4915,4917,4920],{"class":1055,"line":1618},[1053,4913,4914],{"class":1070},"websocket_timeout ",[1053,4916,1158],{"class":1083},[1053,4918,4919],{"class":1501}," 86400",[1053,4921,4922],{"class":1059},"  # 24 hours\n",[1053,4924,4925,4928,4930],{"class":1055,"line":1623},[1053,4926,4927],{"class":1070},"websocket_connect_timeout ",[1053,4929,1158],{"class":1083},[1053,4931,2161],{"class":1501},[1053,4933,4934],{"class":1055,"line":1629},[1053,4935,1104],{"emptyLinePlaceholder":1103},[1053,4937,4938],{"class":1055,"line":1644},[1053,4939,4940],{"class":1059},"# HTTP settings\n",[1053,4942,4943,4946,4948],{"class":1055,"line":1659},[1053,4944,4945],{"class":1070},"http_timeout ",[1053,4947,1158],{"class":1083},[1053,4949,4474],{"class":1501},[1053,4951,4952,4955,4957],{"class":1055,"line":1674},[1053,4953,4954],{"class":1070},"root_path ",[1053,4956,1158],{"class":1083},[1053,4958,4959],{"class":1128}," \"\"\n",[1053,4961,4962],{"class":1055,"line":1730},[1053,4963,1104],{"emptyLinePlaceholder":1103},[1053,4965,4966],{"class":1055,"line":1735},[1053,4967,4968],{"class":1059},"# SSL settings (if needed)\n",[1053,4970,4971],{"class":1055,"line":1741},[1053,4972,4279],{"class":1059},[1053,4974,4975],{"class":1055,"line":1756},[1053,4976,4284],{"class":1059},[1053,4978,4979],{"class":1055,"line":1761},[1053,4980,1104],{"emptyLinePlaceholder":1103},[1053,4982,4983],{"class":1055,"line":1767},[1053,4984,4985],{"class":1059},"# Proxy settings\n",[1053,4987,4988,4991,4993],{"class":1055,"line":1779},[1053,4989,4990],{"class":1070},"proxy_headers ",[1053,4992,1158],{"class":1083},[1053,4994,2273],{"class":1775},[1053,4996,4997,4999,5001,5003,5005,5008,5010,5012,5014,5017,5019],{"class":1055,"line":1794},[1053,4998,2433],{"class":1070},[1053,5000,1158],{"class":1083},[1053,5002,4139],{"class":1083},[1053,5004,1345],{"class":1128},[1053,5006,5007],{"class":1132},"127.0.0.1",[1053,5009,1345],{"class":1128},[1053,5011,1138],{"class":1083},[1053,5013,1485],{"class":1128},[1053,5015,5016],{"class":1132},"10.0.0.0/8",[1053,5018,1345],{"class":1128},[1053,5020,1896],{"class":1083},[1035,5022,5024],{"id":5023},"running-daphne-with-supervisor","Running Daphne with Supervisor",[1043,5026,5028],{"className":2760,"code":5027,"language":2762,"meta":1048,"style":1048},"# /etc/supervisor/conf.d/django-daphne.conf\n[program:django-daphne]\ncommand=/opt/django_app/venv/bin/daphne -b 0.0.0.0 -p 8000 myproject.asgi:application\ndirectory=/opt/django_app\nuser=django\nautostart=true\nautorestart=true\nredirect_stderr=true\nstdout_logfile=/var/log/daphne/django_app.log\nstdout_logfile_maxbytes=50MB\nstdout_logfile_backups=10\nenvironment=DJANGO_SETTINGS_MODULE=\"myproject.settings.production\"\n",[1050,5029,5030,5035,5040,5045,5050,5055,5060,5065,5070,5075,5080,5085],{"__ignoreMap":1048},[1053,5031,5032],{"class":1055,"line":1056},[1053,5033,5034],{},"# /etc/supervisor/conf.d/django-daphne.conf\n",[1053,5036,5037],{"class":1055,"line":1063},[1053,5038,5039],{},"[program:django-daphne]\n",[1053,5041,5042],{"class":1055,"line":1074},[1053,5043,5044],{},"command=/opt/django_app/venv/bin/daphne -b 0.0.0.0 -p 8000 myproject.asgi:application\n",[1053,5046,5047],{"class":1055,"line":1100},[1053,5048,5049],{},"directory=/opt/django_app\n",[1053,5051,5052],{"class":1055,"line":1107},[1053,5053,5054],{},"user=django\n",[1053,5056,5057],{"class":1055,"line":1152},[1053,5058,5059],{},"autostart=true\n",[1053,5061,5062],{"class":1055,"line":1283},[1053,5063,5064],{},"autorestart=true\n",[1053,5066,5067],{"class":1055,"line":1288},[1053,5068,5069],{},"redirect_stderr=true\n",[1053,5071,5072],{"class":1055,"line":1319},[1053,5073,5074],{},"stdout_logfile=/var/log/daphne/django_app.log\n",[1053,5076,5077],{"class":1055,"line":1324},[1053,5078,5079],{},"stdout_logfile_maxbytes=50MB\n",[1053,5081,5082],{"class":1055,"line":1336},[1053,5083,5084],{},"stdout_logfile_backups=10\n",[1053,5086,5087],{"class":1055,"line":1356},[1053,5088,5089],{},"environment=DJANGO_SETTINGS_MODULE=\"myproject.settings.production\"\n",[1030,5091,5093],{"id":5092},"performance-optimization","Performance Optimization",[1035,5095,5097],{"id":5096},"worker-process-optimization","Worker Process Optimization",[1043,5099,5101],{"className":1045,"code":5100,"language":1047,"meta":1048,"style":1048},"# performance/workers.py\nimport multiprocessing\nimport os\n\ndef calculate_workers():\n    \"\"\"Calculate optimal number of workers\"\"\"\n    cpu_count = multiprocessing.cpu_count()\n    \n    # Get workload type from environment\n    workload_type = os.environ.get('WORKLOAD_TYPE', 'mixed')\n    \n    if workload_type == 'cpu':\n        # CPU-bound workload\n        return cpu_count\n    elif workload_type == 'io':\n        # I/O-bound workload\n        return cpu_count * 4\n    else:\n        # Mixed workload (default)\n        return cpu_count * 2 + 1\n\ndef get_worker_class():\n    \"\"\"Determine optimal worker class\"\"\"\n    if os.environ.get('ASYNC_SUPPORT') == 'true':\n        return 'uvicorn.workers.UvicornWorker'\n    elif os.environ.get('GEVENT_SUPPORT') == 'true':\n        return 'gevent'\n    else:\n        return 'sync'\n\n# Dynamic configuration\nWORKERS = calculate_workers()\nWORKER_CLASS = get_worker_class()\n",[1050,5102,5103,5108,5114,5120,5124,5133,5146,5160,5165,5170,5206,5210,5228,5233,5239,5257,5262,5273,5279,5284,5298,5302,5311,5320,5356,5366,5401,5411,5417,5427,5431,5436,5449],{"__ignoreMap":1048},[1053,5104,5105],{"class":1055,"line":1056},[1053,5106,5107],{"class":1059},"# performance/workers.py\n",[1053,5109,5110,5112],{"class":1055,"line":1063},[1053,5111,1067],{"class":1066},[1053,5113,1460],{"class":1070},[1053,5115,5116,5118],{"class":1055,"line":1074},[1053,5117,1067],{"class":1066},[1053,5119,1071],{"class":1070},[1053,5121,5122],{"class":1055,"line":1100},[1053,5123,1104],{"emptyLinePlaceholder":1103},[1053,5125,5126,5128,5131],{"class":1055,"line":1107},[1053,5127,1937],{"class":1936},[1053,5129,5130],{"class":1940}," calculate_workers",[1053,5132,1944],{"class":1083},[1053,5134,5135,5139,5143],{"class":1055,"line":1152},[1053,5136,5138],{"class":5137},"sm7ve","    \"\"\"",[1053,5140,5142],{"class":5141},"sVyVU","Calculate optimal number of workers",[1053,5144,5145],{"class":5137},"\"\"\"\n",[1053,5147,5148,5150,5152,5154,5156,5158],{"class":1055,"line":1283},[1053,5149,1949],{"class":1070},[1053,5151,1158],{"class":1083},[1053,5153,1521],{"class":1070},[1053,5155,1084],{"class":1083},[1053,5157,1526],{"class":1121},[1053,5159,1164],{"class":1083},[1053,5161,5162],{"class":1055,"line":1288},[1053,5163,5164],{"class":1070},"    \n",[1053,5166,5167],{"class":1055,"line":1319},[1053,5168,5169],{"class":1059},"    # Get workload type from environment\n",[1053,5171,5172,5175,5177,5179,5181,5183,5185,5187,5189,5191,5193,5195,5197,5199,5202,5204],{"class":1055,"line":1324},[1053,5173,5174],{"class":1070},"    workload_type ",[1053,5176,1158],{"class":1083},[1053,5178,1972],{"class":1070},[1053,5180,1084],{"class":1083},[1053,5182,1116],{"class":1115},[1053,5184,1084],{"class":1083},[1053,5186,1981],{"class":1121},[1053,5188,1125],{"class":1083},[1053,5190,1129],{"class":1128},[1053,5192,1988],{"class":1132},[1053,5194,1129],{"class":1128},[1053,5196,1138],{"class":1083},[1053,5198,1141],{"class":1128},[1053,5200,5201],{"class":1132},"mixed",[1053,5203,1129],{"class":1128},[1053,5205,1149],{"class":1083},[1053,5207,5208],{"class":1055,"line":1336},[1053,5209,5164],{"class":1070},[1053,5211,5212,5214,5217,5220,5222,5224,5226],{"class":1055,"line":1356},[1053,5213,1969],{"class":1066},[1053,5215,5216],{"class":1070}," workload_type ",[1053,5218,5219],{"class":1532},"==",[1053,5221,1141],{"class":1128},[1053,5223,2001],{"class":1132},[1053,5225,1129],{"class":1128},[1053,5227,2006],{"class":1083},[1053,5229,5230],{"class":1055,"line":1374},[1053,5231,5232],{"class":1059},"        # CPU-bound workload\n",[1053,5234,5235,5237],{"class":1055,"line":1382},[1053,5236,2011],{"class":1066},[1053,5238,2014],{"class":1070},[1053,5240,5241,5244,5246,5248,5250,5253,5255],{"class":1055,"line":1398},[1053,5242,5243],{"class":1066},"    elif",[1053,5245,5216],{"class":1070},[1053,5247,5219],{"class":1532},[1053,5249,1141],{"class":1128},[1053,5251,5252],{"class":1132},"io",[1053,5254,1129],{"class":1128},[1053,5256,2006],{"class":1083},[1053,5258,5259],{"class":1055,"line":1404},[1053,5260,5261],{"class":1059},"        # I/O-bound workload\n",[1053,5263,5264,5266,5268,5270],{"class":1055,"line":1410},[1053,5265,2011],{"class":1066},[1053,5267,2033],{"class":1070},[1053,5269,2036],{"class":1532},[1053,5271,5272],{"class":1501}," 4\n",[1053,5274,5275,5277],{"class":1055,"line":1607},[1053,5276,2024],{"class":1066},[1053,5278,2006],{"class":1083},[1053,5280,5281],{"class":1055,"line":1618},[1053,5282,5283],{"class":1059},"        # Mixed workload (default)\n",[1053,5285,5286,5288,5290,5292,5294,5296],{"class":1055,"line":1623},[1053,5287,2011],{"class":1066},[1053,5289,2033],{"class":1070},[1053,5291,2036],{"class":1532},[1053,5293,1536],{"class":1501},[1053,5295,1539],{"class":1532},[1053,5297,1542],{"class":1501},[1053,5299,5300],{"class":1055,"line":1629},[1053,5301,1104],{"emptyLinePlaceholder":1103},[1053,5303,5304,5306,5309],{"class":1055,"line":1644},[1053,5305,1937],{"class":1936},[1053,5307,5308],{"class":1940}," get_worker_class",[1053,5310,1944],{"class":1083},[1053,5312,5313,5315,5318],{"class":1055,"line":1659},[1053,5314,5138],{"class":5137},[1053,5316,5317],{"class":5141},"Determine optimal worker class",[1053,5319,5145],{"class":5137},[1053,5321,5322,5324,5326,5328,5330,5332,5334,5336,5338,5341,5343,5345,5347,5349,5352,5354],{"class":1055,"line":1674},[1053,5323,1969],{"class":1066},[1053,5325,1972],{"class":1070},[1053,5327,1084],{"class":1083},[1053,5329,1116],{"class":1115},[1053,5331,1084],{"class":1083},[1053,5333,1981],{"class":1121},[1053,5335,1125],{"class":1083},[1053,5337,1129],{"class":1128},[1053,5339,5340],{"class":1132},"ASYNC_SUPPORT",[1053,5342,1129],{"class":1128},[1053,5344,1993],{"class":1083},[1053,5346,1996],{"class":1532},[1053,5348,1141],{"class":1128},[1053,5350,5351],{"class":1132},"true",[1053,5353,1129],{"class":1128},[1053,5355,2006],{"class":1083},[1053,5357,5358,5360,5362,5364],{"class":1055,"line":1730},[1053,5359,2011],{"class":1066},[1053,5361,1141],{"class":1128},[1053,5363,4446],{"class":1132},[1053,5365,1727],{"class":1128},[1053,5367,5368,5370,5372,5374,5376,5378,5380,5382,5384,5387,5389,5391,5393,5395,5397,5399],{"class":1055,"line":1735},[1053,5369,5243],{"class":1066},[1053,5371,1972],{"class":1070},[1053,5373,1084],{"class":1083},[1053,5375,1116],{"class":1115},[1053,5377,1084],{"class":1083},[1053,5379,1981],{"class":1121},[1053,5381,1125],{"class":1083},[1053,5383,1129],{"class":1128},[1053,5385,5386],{"class":1132},"GEVENT_SUPPORT",[1053,5388,1129],{"class":1128},[1053,5390,1993],{"class":1083},[1053,5392,1996],{"class":1532},[1053,5394,1141],{"class":1128},[1053,5396,5351],{"class":1132},[1053,5398,1129],{"class":1128},[1053,5400,2006],{"class":1083},[1053,5402,5403,5405,5407,5409],{"class":1055,"line":1741},[1053,5404,2011],{"class":1066},[1053,5406,1141],{"class":1128},[1053,5408,2127],{"class":1132},[1053,5410,1727],{"class":1128},[1053,5412,5413,5415],{"class":1055,"line":1756},[1053,5414,2024],{"class":1066},[1053,5416,2006],{"class":1083},[1053,5418,5419,5421,5423,5425],{"class":1055,"line":1761},[1053,5420,2011],{"class":1066},[1053,5422,1141],{"class":1128},[1053,5424,1554],{"class":1132},[1053,5426,1727],{"class":1128},[1053,5428,5429],{"class":1055,"line":1767},[1053,5430,1104],{"emptyLinePlaceholder":1103},[1053,5432,5433],{"class":1055,"line":1779},[1053,5434,5435],{"class":1059},"# Dynamic configuration\n",[1053,5437,5438,5442,5445,5447],{"class":1055,"line":1794},[1053,5439,5441],{"class":5440},"se3Ec","WORKERS",[1053,5443,5444],{"class":1083}," =",[1053,5446,5130],{"class":1121},[1053,5448,1164],{"class":1083},[1053,5450,5451,5454,5456,5458],{"class":1055,"line":1809},[1053,5452,5453],{"class":5440},"WORKER_CLASS",[1053,5455,5444],{"class":1083},[1053,5457,5308],{"class":1121},[1053,5459,1164],{"class":1083},[1035,5461,5463],{"id":5462},"memory-management","Memory Management",[1043,5465,5467],{"className":1045,"code":5466,"language":1047,"meta":1048,"style":1048},"# performance/memory.py\nimport psutil\nimport os\n\ndef get_memory_limits():\n    \"\"\"Calculate memory limits based on available RAM\"\"\"\n    total_memory = psutil.virtual_memory().total\n    available_memory = total_memory * 0.8  # Use 80% of total memory\n    \n    workers = int(os.environ.get('WEB_CONCURRENCY', 4))\n    memory_per_worker = available_memory / workers\n    \n    return {\n        'max_requests': max(500, int(memory_per_worker / (50 * 1024 * 1024))),  # 50MB per request\n        'max_requests_jitter': 50,\n        'worker_memory_limit': int(memory_per_worker),\n    }\n\ndef monitor_memory_usage():\n    \"\"\"Monitor and log memory usage\"\"\"\n    process = psutil.Process()\n    memory_info = process.memory_info()\n    \n    return {\n        'rss': memory_info.rss,\n        'vms': memory_info.vms,\n        'percent': process.memory_percent(),\n    }\n",[1050,5468,5469,5474,5481,5487,5491,5500,5509,5530,5548,5552,5592,5608,5612,5619,5672,5688,5709,5714,5718,5727,5736,5752,5769,5773,5779,5799,5818,5838],{"__ignoreMap":1048},[1053,5470,5471],{"class":1055,"line":1056},[1053,5472,5473],{"class":1059},"# performance/memory.py\n",[1053,5475,5476,5478],{"class":1055,"line":1063},[1053,5477,1067],{"class":1066},[1053,5479,5480],{"class":1070}," psutil\n",[1053,5482,5483,5485],{"class":1055,"line":1074},[1053,5484,1067],{"class":1066},[1053,5486,1071],{"class":1070},[1053,5488,5489],{"class":1055,"line":1100},[1053,5490,1104],{"emptyLinePlaceholder":1103},[1053,5492,5493,5495,5498],{"class":1055,"line":1107},[1053,5494,1937],{"class":1936},[1053,5496,5497],{"class":1940}," get_memory_limits",[1053,5499,1944],{"class":1083},[1053,5501,5502,5504,5507],{"class":1055,"line":1152},[1053,5503,5138],{"class":5137},[1053,5505,5506],{"class":5141},"Calculate memory limits based on available RAM",[1053,5508,5145],{"class":5137},[1053,5510,5511,5514,5516,5519,5521,5524,5527],{"class":1055,"line":1283},[1053,5512,5513],{"class":1070},"    total_memory ",[1053,5515,1158],{"class":1083},[1053,5517,5518],{"class":1070}," psutil",[1053,5520,1084],{"class":1083},[1053,5522,5523],{"class":1121},"virtual_memory",[1053,5525,5526],{"class":1083},"().",[1053,5528,5529],{"class":1115},"total\n",[1053,5531,5532,5535,5537,5540,5542,5545],{"class":1055,"line":1288},[1053,5533,5534],{"class":1070},"    available_memory ",[1053,5536,1158],{"class":1083},[1053,5538,5539],{"class":1070}," total_memory ",[1053,5541,2036],{"class":1532},[1053,5543,5544],{"class":1501}," 0.8",[1053,5546,5547],{"class":1059},"  # Use 80% of total memory\n",[1053,5549,5550],{"class":1055,"line":1319},[1053,5551,5164],{"class":1070},[1053,5553,5554,5557,5559,5563,5565,5567,5569,5571,5573,5575,5577,5579,5582,5584,5586,5589],{"class":1055,"line":1324},[1053,5555,5556],{"class":1070},"    workers ",[1053,5558,1158],{"class":1083},[1053,5560,5562],{"class":5561},"sa2tF"," int",[1053,5564,1125],{"class":1083},[1053,5566,1110],{"class":1121},[1053,5568,1084],{"class":1083},[1053,5570,1116],{"class":1115},[1053,5572,1084],{"class":1083},[1053,5574,1981],{"class":1121},[1053,5576,1125],{"class":1083},[1053,5578,1129],{"class":1128},[1053,5580,5581],{"class":1132},"WEB_CONCURRENCY",[1053,5583,1129],{"class":1128},[1053,5585,1138],{"class":1083},[1053,5587,5588],{"class":1501}," 4",[1053,5590,5591],{"class":1083},"))\n",[1053,5593,5594,5597,5599,5602,5605],{"class":1055,"line":1336},[1053,5595,5596],{"class":1070},"    memory_per_worker ",[1053,5598,1158],{"class":1083},[1053,5600,5601],{"class":1070}," available_memory ",[1053,5603,5604],{"class":1532},"/",[1053,5606,5607],{"class":1070}," workers\n",[1053,5609,5610],{"class":1055,"line":1356},[1053,5611,5164],{"class":1070},[1053,5613,5614,5617],{"class":1055,"line":1374},[1053,5615,5616],{"class":1066},"    return",[1053,5618,3782],{"class":1083},[1053,5620,5621,5624,5627,5629,5631,5635,5637,5640,5642,5644,5646,5649,5651,5654,5657,5659,5662,5664,5666,5669],{"class":1055,"line":1382},[1053,5622,5623],{"class":1128},"        '",[1053,5625,5626],{"class":1132},"max_requests",[1053,5628,1129],{"class":1128},[1053,5630,1171],{"class":1083},[1053,5632,5634],{"class":5633},"sJdAF"," max",[1053,5636,1125],{"class":1083},[1053,5638,5639],{"class":1501},"500",[1053,5641,1138],{"class":1083},[1053,5643,5562],{"class":5561},[1053,5645,1125],{"class":1083},[1053,5647,5648],{"class":1121},"memory_per_worker ",[1053,5650,5604],{"class":1532},[1053,5652,5653],{"class":1083}," (",[1053,5655,5656],{"class":1501},"50",[1053,5658,1533],{"class":1532},[1053,5660,5661],{"class":1501}," 1024",[1053,5663,1533],{"class":1532},[1053,5665,5661],{"class":1501},[1053,5667,5668],{"class":1083},"))),",[1053,5670,5671],{"class":1059},"  # 50MB per request\n",[1053,5673,5674,5676,5679,5681,5683,5686],{"class":1055,"line":1398},[1053,5675,5623],{"class":1128},[1053,5677,5678],{"class":1132},"max_requests_jitter",[1053,5680,1129],{"class":1128},[1053,5682,1171],{"class":1083},[1053,5684,5685],{"class":1501}," 50",[1053,5687,1890],{"class":1083},[1053,5689,5690,5692,5695,5697,5699,5701,5703,5706],{"class":1055,"line":1404},[1053,5691,5623],{"class":1128},[1053,5693,5694],{"class":1132},"worker_memory_limit",[1053,5696,1129],{"class":1128},[1053,5698,1171],{"class":1083},[1053,5700,5562],{"class":5561},[1053,5702,1125],{"class":1083},[1053,5704,5705],{"class":1121},"memory_per_worker",[1053,5707,5708],{"class":1083},"),\n",[1053,5710,5711],{"class":1055,"line":1410},[1053,5712,5713],{"class":1083},"    }\n",[1053,5715,5716],{"class":1055,"line":1607},[1053,5717,1104],{"emptyLinePlaceholder":1103},[1053,5719,5720,5722,5725],{"class":1055,"line":1618},[1053,5721,1937],{"class":1936},[1053,5723,5724],{"class":1940}," monitor_memory_usage",[1053,5726,1944],{"class":1083},[1053,5728,5729,5731,5734],{"class":1055,"line":1623},[1053,5730,5138],{"class":5137},[1053,5732,5733],{"class":5141},"Monitor and log memory usage",[1053,5735,5145],{"class":5137},[1053,5737,5738,5741,5743,5745,5747,5750],{"class":1055,"line":1629},[1053,5739,5740],{"class":1070},"    process ",[1053,5742,1158],{"class":1083},[1053,5744,5518],{"class":1070},[1053,5746,1084],{"class":1083},[1053,5748,5749],{"class":1121},"Process",[1053,5751,1164],{"class":1083},[1053,5753,5754,5757,5759,5762,5764,5767],{"class":1055,"line":1644},[1053,5755,5756],{"class":1070},"    memory_info ",[1053,5758,1158],{"class":1083},[1053,5760,5761],{"class":1070}," process",[1053,5763,1084],{"class":1083},[1053,5765,5766],{"class":1121},"memory_info",[1053,5768,1164],{"class":1083},[1053,5770,5771],{"class":1055,"line":1659},[1053,5772,5164],{"class":1070},[1053,5774,5775,5777],{"class":1055,"line":1674},[1053,5776,5616],{"class":1066},[1053,5778,3782],{"class":1083},[1053,5780,5781,5783,5786,5788,5790,5793,5795,5797],{"class":1055,"line":1730},[1053,5782,5623],{"class":1128},[1053,5784,5785],{"class":1132},"rss",[1053,5787,1129],{"class":1128},[1053,5789,1171],{"class":1083},[1053,5791,5792],{"class":1070}," memory_info",[1053,5794,1084],{"class":1083},[1053,5796,5785],{"class":1115},[1053,5798,1890],{"class":1083},[1053,5800,5801,5803,5806,5808,5810,5812,5814,5816],{"class":1055,"line":1735},[1053,5802,5623],{"class":1128},[1053,5804,5805],{"class":1132},"vms",[1053,5807,1129],{"class":1128},[1053,5809,1171],{"class":1083},[1053,5811,5792],{"class":1070},[1053,5813,1084],{"class":1083},[1053,5815,5805],{"class":1115},[1053,5817,1890],{"class":1083},[1053,5819,5820,5822,5825,5827,5829,5831,5833,5836],{"class":1055,"line":1741},[1053,5821,5623],{"class":1128},[1053,5823,5824],{"class":1132},"percent",[1053,5826,1129],{"class":1128},[1053,5828,1171],{"class":1083},[1053,5830,5761],{"class":1070},[1053,5832,1084],{"class":1083},[1053,5834,5835],{"class":1121},"memory_percent",[1053,5837,1353],{"class":1083},[1053,5839,5840],{"class":1055,"line":1756},[1053,5841,5713],{"class":1083},[1035,5843,5845],{"id":5844},"load-testing-configuration","Load Testing Configuration",[1043,5847,5849],{"className":1045,"code":5848,"language":1047,"meta":1048,"style":1048},"# scripts/load_test.py\nimport asyncio\nimport aiohttp\nimport time\nfrom concurrent.futures import ThreadPoolExecutor\n\nasync def test_endpoint(session, url, semaphore):\n    \"\"\"Test single endpoint\"\"\"\n    async with semaphore:\n        start_time = time.time()\n        try:\n            async with session.get(url) as response:\n                await response.text()\n                return {\n                    'status': response.status,\n                    'time': time.time() - start_time,\n                    'success': response.status == 200\n                }\n        except Exception as e:\n            return {\n                'status': 0,\n                'time': time.time() - start_time,\n                'success': False,\n                'error': str(e)\n            }\n\nasync def load_test(url, concurrent_requests=100, total_requests=1000):\n    \"\"\"Run load test\"\"\"\n    semaphore = asyncio.Semaphore(concurrent_requests)\n    \n    async with aiohttp.ClientSession() as session:\n        tasks = [\n            test_endpoint(session, url, semaphore)\n            for _ in range(total_requests)\n        ]\n        \n        start_time = time.time()\n        results = await asyncio.gather(*tasks)\n        total_time = time.time() - start_time\n        \n        # Calculate statistics\n        successful_requests = sum(1 for r in results if r['success'])\n        failed_requests = total_requests - successful_requests\n        avg_response_time = sum(r['time'] for r in results) / len(results)\n        requests_per_second = total_requests / total_time\n        \n        print(f\"Load Test Results:\")\n        print(f\"  Total Requests: {total_requests}\")\n        print(f\"  Successful: {successful_requests}\")\n        print(f\"  Failed: {failed_requests}\")\n        print(f\"  Average Response Time: {avg_response_time:.3f}s\")\n        print(f\"  Requests per Second: {requests_per_second:.2f}\")\n        print(f\"  Total Time: {total_time:.2f}s\")\n\nif __name__ == \"__main__\":\n    asyncio.run(load_test(\"http://localhost:8000/\"))\n",[1050,5850,5851,5856,5863,5870,5877,5894,5898,5926,5935,5947,5964,5971,6000,6014,6021,6041,6067,6089,6094,6109,6116,6132,6156,6170,6191,6196,6200,6235,6244,6266,6270,6292,6301,6320,6341,6346,6351,6365,6391,6411,6415,6420,6464,6480,6529,6543,6547,6562,6585,6607,6629,6655,6680,6704,6708,6727],{"__ignoreMap":1048},[1053,5852,5853],{"class":1055,"line":1056},[1053,5854,5855],{"class":1059},"# scripts/load_test.py\n",[1053,5857,5858,5860],{"class":1055,"line":1063},[1053,5859,1067],{"class":1066},[1053,5861,5862],{"class":1070}," asyncio\n",[1053,5864,5865,5867],{"class":1055,"line":1074},[1053,5866,1067],{"class":1066},[1053,5868,5869],{"class":1070}," aiohttp\n",[1053,5871,5872,5874],{"class":1055,"line":1100},[1053,5873,1067],{"class":1066},[1053,5875,5876],{"class":1070}," time\n",[1053,5878,5879,5881,5884,5886,5889,5891],{"class":1055,"line":1107},[1053,5880,1077],{"class":1066},[1053,5882,5883],{"class":1070}," concurrent",[1053,5885,1084],{"class":1083},[1053,5887,5888],{"class":1070},"futures ",[1053,5890,1067],{"class":1066},[1053,5892,5893],{"class":1070}," ThreadPoolExecutor\n",[1053,5895,5896],{"class":1055,"line":1152},[1053,5897,1104],{"emptyLinePlaceholder":1103},[1053,5899,5900,5903,5906,5909,5911,5914,5916,5919,5921,5924],{"class":1055,"line":1283},[1053,5901,5902],{"class":1936},"async",[1053,5904,5905],{"class":1936}," def",[1053,5907,5908],{"class":1940}," test_endpoint",[1053,5910,1125],{"class":1083},[1053,5912,5913],{"class":2466},"session",[1053,5915,1138],{"class":1083},[1053,5917,5918],{"class":2466}," url",[1053,5920,1138],{"class":1083},[1053,5922,5923],{"class":2466}," semaphore",[1053,5925,2470],{"class":1083},[1053,5927,5928,5930,5933],{"class":1055,"line":1288},[1053,5929,5138],{"class":5137},[1053,5931,5932],{"class":5141},"Test single endpoint",[1053,5934,5145],{"class":5137},[1053,5936,5937,5940,5943,5945],{"class":1055,"line":1319},[1053,5938,5939],{"class":1066},"    async",[1053,5941,5942],{"class":1066}," with",[1053,5944,5923],{"class":1070},[1053,5946,2006],{"class":1083},[1053,5948,5949,5952,5954,5957,5959,5962],{"class":1055,"line":1324},[1053,5950,5951],{"class":1070},"        start_time ",[1053,5953,1158],{"class":1083},[1053,5955,5956],{"class":1070}," time",[1053,5958,1084],{"class":1083},[1053,5960,5961],{"class":1121},"time",[1053,5963,1164],{"class":1083},[1053,5965,5966,5969],{"class":1055,"line":1336},[1053,5967,5968],{"class":1066},"        try",[1053,5970,2006],{"class":1083},[1053,5972,5973,5976,5978,5981,5983,5985,5987,5990,5992,5995,5998],{"class":1055,"line":1356},[1053,5974,5975],{"class":1066},"            async",[1053,5977,5942],{"class":1066},[1053,5979,5980],{"class":1070}," session",[1053,5982,1084],{"class":1083},[1053,5984,1981],{"class":1121},[1053,5986,1125],{"class":1083},[1053,5988,5989],{"class":1121},"url",[1053,5991,1993],{"class":1083},[1053,5993,5994],{"class":1066}," as",[1053,5996,5997],{"class":1070}," response",[1053,5999,2006],{"class":1083},[1053,6001,6002,6005,6007,6009,6012],{"class":1055,"line":1374},[1053,6003,6004],{"class":1066},"                await",[1053,6006,5997],{"class":1070},[1053,6008,1084],{"class":1083},[1053,6010,6011],{"class":1121},"text",[1053,6013,1164],{"class":1083},[1053,6015,6016,6019],{"class":1055,"line":1382},[1053,6017,6018],{"class":1066},"                return",[1053,6020,3782],{"class":1083},[1053,6022,6023,6026,6029,6031,6033,6035,6037,6039],{"class":1055,"line":1398},[1053,6024,6025],{"class":1128},"                    '",[1053,6027,6028],{"class":1132},"status",[1053,6030,1129],{"class":1128},[1053,6032,1171],{"class":1083},[1053,6034,5997],{"class":1070},[1053,6036,1084],{"class":1083},[1053,6038,6028],{"class":1115},[1053,6040,1890],{"class":1083},[1053,6042,6043,6045,6047,6049,6051,6053,6055,6057,6059,6062,6065],{"class":1055,"line":1404},[1053,6044,6025],{"class":1128},[1053,6046,5961],{"class":1132},[1053,6048,1129],{"class":1128},[1053,6050,1171],{"class":1083},[1053,6052,5956],{"class":1070},[1053,6054,1084],{"class":1083},[1053,6056,5961],{"class":1121},[1053,6058,1529],{"class":1083},[1053,6060,6061],{"class":1532}," -",[1053,6063,6064],{"class":1070}," start_time",[1053,6066,1890],{"class":1083},[1053,6068,6069,6071,6074,6076,6078,6080,6082,6084,6086],{"class":1055,"line":1410},[1053,6070,6025],{"class":1128},[1053,6072,6073],{"class":1132},"success",[1053,6075,1129],{"class":1128},[1053,6077,1171],{"class":1083},[1053,6079,5997],{"class":1070},[1053,6081,1084],{"class":1083},[1053,6083,6028],{"class":1115},[1053,6085,1996],{"class":1532},[1053,6087,6088],{"class":1501}," 200\n",[1053,6090,6091],{"class":1055,"line":1607},[1053,6092,6093],{"class":1083},"                }\n",[1053,6095,6096,6099,6102,6104,6107],{"class":1055,"line":1618},[1053,6097,6098],{"class":1066},"        except",[1053,6100,6101],{"class":5561}," Exception",[1053,6103,5994],{"class":1066},[1053,6105,6106],{"class":1070}," e",[1053,6108,2006],{"class":1083},[1053,6110,6111,6114],{"class":1055,"line":1623},[1053,6112,6113],{"class":1066},"            return",[1053,6115,3782],{"class":1083},[1053,6117,6118,6121,6123,6125,6127,6130],{"class":1055,"line":1629},[1053,6119,6120],{"class":1128},"                '",[1053,6122,6028],{"class":1132},[1053,6124,1129],{"class":1128},[1053,6126,1171],{"class":1083},[1053,6128,6129],{"class":1501}," 0",[1053,6131,1890],{"class":1083},[1053,6133,6134,6136,6138,6140,6142,6144,6146,6148,6150,6152,6154],{"class":1055,"line":1644},[1053,6135,6120],{"class":1128},[1053,6137,5961],{"class":1132},[1053,6139,1129],{"class":1128},[1053,6141,1171],{"class":1083},[1053,6143,5956],{"class":1070},[1053,6145,1084],{"class":1083},[1053,6147,5961],{"class":1121},[1053,6149,1529],{"class":1083},[1053,6151,6061],{"class":1532},[1053,6153,6064],{"class":1070},[1053,6155,1890],{"class":1083},[1053,6157,6158,6160,6162,6164,6166,6168],{"class":1055,"line":1659},[1053,6159,6120],{"class":1128},[1053,6161,6073],{"class":1132},[1053,6163,1129],{"class":1128},[1053,6165,1171],{"class":1083},[1053,6167,3812],{"class":1775},[1053,6169,1890],{"class":1083},[1053,6171,6172,6174,6177,6179,6181,6184,6186,6189],{"class":1055,"line":1674},[1053,6173,6120],{"class":1128},[1053,6175,6176],{"class":1132},"error",[1053,6178,1129],{"class":1128},[1053,6180,1171],{"class":1083},[1053,6182,6183],{"class":5561}," str",[1053,6185,1125],{"class":1083},[1053,6187,6188],{"class":1121},"e",[1053,6190,1149],{"class":1083},[1053,6192,6193],{"class":1055,"line":1730},[1053,6194,6195],{"class":1083},"            }\n",[1053,6197,6198],{"class":1055,"line":1735},[1053,6199,1104],{"emptyLinePlaceholder":1103},[1053,6201,6202,6204,6206,6209,6211,6213,6215,6218,6220,6223,6225,6228,6230,6233],{"class":1055,"line":1741},[1053,6203,5902],{"class":1936},[1053,6205,5905],{"class":1936},[1053,6207,6208],{"class":1940}," load_test",[1053,6210,1125],{"class":1083},[1053,6212,5989],{"class":2466},[1053,6214,1138],{"class":1083},[1053,6216,6217],{"class":2466}," concurrent_requests",[1053,6219,1158],{"class":1532},[1053,6221,6222],{"class":1501},"100",[1053,6224,1138],{"class":1083},[1053,6226,6227],{"class":2466}," total_requests",[1053,6229,1158],{"class":1532},[1053,6231,6232],{"class":1501},"1000",[1053,6234,2470],{"class":1083},[1053,6236,6237,6239,6242],{"class":1055,"line":1756},[1053,6238,5138],{"class":5137},[1053,6240,6241],{"class":5141},"Run load test",[1053,6243,5145],{"class":5137},[1053,6245,6246,6249,6251,6254,6256,6259,6261,6264],{"class":1055,"line":1761},[1053,6247,6248],{"class":1070},"    semaphore ",[1053,6250,1158],{"class":1083},[1053,6252,6253],{"class":1070}," asyncio",[1053,6255,1084],{"class":1083},[1053,6257,6258],{"class":1121},"Semaphore",[1053,6260,1125],{"class":1083},[1053,6262,6263],{"class":1121},"concurrent_requests",[1053,6265,1149],{"class":1083},[1053,6267,6268],{"class":1055,"line":1767},[1053,6269,5164],{"class":1070},[1053,6271,6272,6274,6276,6279,6281,6284,6286,6288,6290],{"class":1055,"line":1779},[1053,6273,5939],{"class":1066},[1053,6275,5942],{"class":1066},[1053,6277,6278],{"class":1070}," aiohttp",[1053,6280,1084],{"class":1083},[1053,6282,6283],{"class":1121},"ClientSession",[1053,6285,1529],{"class":1083},[1053,6287,5994],{"class":1066},[1053,6289,5980],{"class":1070},[1053,6291,2006],{"class":1083},[1053,6293,6294,6297,6299],{"class":1055,"line":1794},[1053,6295,6296],{"class":1070},"        tasks ",[1053,6298,1158],{"class":1083},[1053,6300,1876],{"class":1083},[1053,6302,6303,6306,6308,6310,6312,6314,6316,6318],{"class":1055,"line":1809},[1053,6304,6305],{"class":1121},"            test_endpoint",[1053,6307,1125],{"class":1083},[1053,6309,5913],{"class":1121},[1053,6311,1138],{"class":1083},[1053,6313,5918],{"class":1121},[1053,6315,1138],{"class":1083},[1053,6317,5923],{"class":1121},[1053,6319,1149],{"class":1083},[1053,6321,6322,6325,6328,6331,6334,6336,6339],{"class":1055,"line":1823},[1053,6323,6324],{"class":1066},"            for",[1053,6326,6327],{"class":1070}," _ ",[1053,6329,6330],{"class":1066},"in",[1053,6332,6333],{"class":5633}," range",[1053,6335,1125],{"class":1083},[1053,6337,6338],{"class":1121},"total_requests",[1053,6340,1149],{"class":1083},[1053,6342,6343],{"class":1055,"line":1834},[1053,6344,6345],{"class":1083},"        ]\n",[1053,6347,6348],{"class":1055,"line":1839},[1053,6349,6350],{"class":1070},"        \n",[1053,6352,6353,6355,6357,6359,6361,6363],{"class":1055,"line":1845},[1053,6354,5951],{"class":1070},[1053,6356,1158],{"class":1083},[1053,6358,5956],{"class":1070},[1053,6360,1084],{"class":1083},[1053,6362,5961],{"class":1121},[1053,6364,1164],{"class":1083},[1053,6366,6367,6370,6372,6375,6377,6379,6382,6384,6386,6389],{"class":1055,"line":1851},[1053,6368,6369],{"class":1070},"        results ",[1053,6371,1158],{"class":1083},[1053,6373,6374],{"class":1066}," await",[1053,6376,6253],{"class":1070},[1053,6378,1084],{"class":1083},[1053,6380,6381],{"class":1121},"gather",[1053,6383,1125],{"class":1083},[1053,6385,2036],{"class":1532},[1053,6387,6388],{"class":1121},"tasks",[1053,6390,1149],{"class":1083},[1053,6392,6393,6396,6398,6400,6402,6404,6406,6408],{"class":1055,"line":1857},[1053,6394,6395],{"class":1070},"        total_time ",[1053,6397,1158],{"class":1083},[1053,6399,5956],{"class":1070},[1053,6401,1084],{"class":1083},[1053,6403,5961],{"class":1121},[1053,6405,1529],{"class":1083},[1053,6407,6061],{"class":1532},[1053,6409,6410],{"class":1070}," start_time\n",[1053,6412,6413],{"class":1055,"line":1862},[1053,6414,6350],{"class":1070},[1053,6416,6417],{"class":1055,"line":1868},[1053,6418,6419],{"class":1059},"        # Calculate statistics\n",[1053,6421,6422,6425,6427,6430,6432,6435,6438,6441,6443,6446,6449,6452,6455,6457,6459,6461],{"class":1055,"line":1879},[1053,6423,6424],{"class":1070},"        successful_requests ",[1053,6426,1158],{"class":1083},[1053,6428,6429],{"class":5633}," sum",[1053,6431,1125],{"class":1083},[1053,6433,6434],{"class":1501},"1",[1053,6436,6437],{"class":1066}," for",[1053,6439,6440],{"class":1121}," r ",[1053,6442,6330],{"class":1066},[1053,6444,6445],{"class":1121}," results ",[1053,6447,6448],{"class":1066},"if",[1053,6450,6451],{"class":1121}," r",[1053,6453,6454],{"class":1083},"[",[1053,6456,1129],{"class":1128},[1053,6458,6073],{"class":1132},[1053,6460,1129],{"class":1128},[1053,6462,6463],{"class":1083},"])\n",[1053,6465,6466,6469,6471,6474,6477],{"class":1055,"line":1893},[1053,6467,6468],{"class":1070},"        failed_requests ",[1053,6470,1158],{"class":1083},[1053,6472,6473],{"class":1070}," total_requests ",[1053,6475,6476],{"class":1532},"-",[1053,6478,6479],{"class":1070}," successful_requests\n",[1053,6481,6482,6485,6487,6489,6491,6494,6496,6498,6500,6502,6505,6507,6509,6511,6514,6516,6519,6522,6524,6527],{"class":1055,"line":2289},[1053,6483,6484],{"class":1070},"        avg_response_time ",[1053,6486,1158],{"class":1083},[1053,6488,6429],{"class":5633},[1053,6490,1125],{"class":1083},[1053,6492,6493],{"class":1121},"r",[1053,6495,6454],{"class":1083},[1053,6497,1129],{"class":1128},[1053,6499,5961],{"class":1132},[1053,6501,1129],{"class":1128},[1053,6503,6504],{"class":1083},"]",[1053,6506,6437],{"class":1066},[1053,6508,6440],{"class":1121},[1053,6510,6330],{"class":1066},[1053,6512,6513],{"class":1121}," results",[1053,6515,1993],{"class":1083},[1053,6517,6518],{"class":1532}," /",[1053,6520,6521],{"class":5633}," len",[1053,6523,1125],{"class":1083},[1053,6525,6526],{"class":1121},"results",[1053,6528,1149],{"class":1083},[1053,6530,6531,6534,6536,6538,6540],{"class":1055,"line":2295},[1053,6532,6533],{"class":1070},"        requests_per_second ",[1053,6535,1158],{"class":1083},[1053,6537,6473],{"class":1070},[1053,6539,5604],{"class":1532},[1053,6541,6542],{"class":1070}," total_time\n",[1053,6544,6545],{"class":1055,"line":2305},[1053,6546,6350],{"class":1070},[1053,6548,6549,6552,6554,6557,6560],{"class":1055,"line":2331},[1053,6550,6551],{"class":5633},"        print",[1053,6553,1125],{"class":1083},[1053,6555,6556],{"class":1936},"f",[1053,6558,6559],{"class":1132},"\"Load Test Results:\"",[1053,6561,1149],{"class":1083},[1053,6563,6564,6566,6568,6570,6573,6576,6578,6581,6583],{"class":1055,"line":2353},[1053,6565,6551],{"class":5633},[1053,6567,1125],{"class":1083},[1053,6569,6556],{"class":1936},[1053,6571,6572],{"class":1132},"\"  Total Requests: ",[1053,6574,6575],{"class":1684},"{",[1053,6577,6338],{"class":1121},[1053,6579,6580],{"class":1684},"}",[1053,6582,1345],{"class":1132},[1053,6584,1149],{"class":1083},[1053,6586,6587,6589,6591,6593,6596,6598,6601,6603,6605],{"class":1055,"line":2358},[1053,6588,6551],{"class":5633},[1053,6590,1125],{"class":1083},[1053,6592,6556],{"class":1936},[1053,6594,6595],{"class":1132},"\"  Successful: ",[1053,6597,6575],{"class":1684},[1053,6599,6600],{"class":1121},"successful_requests",[1053,6602,6580],{"class":1684},[1053,6604,1345],{"class":1132},[1053,6606,1149],{"class":1083},[1053,6608,6609,6611,6613,6615,6618,6620,6623,6625,6627],{"class":1055,"line":2363},[1053,6610,6551],{"class":5633},[1053,6612,1125],{"class":1083},[1053,6614,6556],{"class":1936},[1053,6616,6617],{"class":1132},"\"  Failed: ",[1053,6619,6575],{"class":1684},[1053,6621,6622],{"class":1121},"failed_requests",[1053,6624,6580],{"class":1684},[1053,6626,1345],{"class":1132},[1053,6628,1149],{"class":1083},[1053,6630,6631,6633,6635,6637,6640,6642,6645,6648,6650,6653],{"class":1055,"line":2369},[1053,6632,6551],{"class":5633},[1053,6634,1125],{"class":1083},[1053,6636,6556],{"class":1936},[1053,6638,6639],{"class":1132},"\"  Average Response Time: ",[1053,6641,6575],{"class":1684},[1053,6643,6644],{"class":1121},"avg_response_time",[1053,6646,6647],{"class":1936},":.3f",[1053,6649,6580],{"class":1684},[1053,6651,6652],{"class":1132},"s\"",[1053,6654,1149],{"class":1083},[1053,6656,6657,6659,6661,6663,6666,6668,6671,6674,6676,6678],{"class":1055,"line":2380},[1053,6658,6551],{"class":5633},[1053,6660,1125],{"class":1083},[1053,6662,6556],{"class":1936},[1053,6664,6665],{"class":1132},"\"  Requests per Second: ",[1053,6667,6575],{"class":1684},[1053,6669,6670],{"class":1121},"requests_per_second",[1053,6672,6673],{"class":1936},":.2f",[1053,6675,6580],{"class":1684},[1053,6677,1345],{"class":1132},[1053,6679,1149],{"class":1083},[1053,6681,6682,6684,6686,6688,6691,6693,6696,6698,6700,6702],{"class":1055,"line":2390},[1053,6683,6551],{"class":5633},[1053,6685,1125],{"class":1083},[1053,6687,6556],{"class":1936},[1053,6689,6690],{"class":1132},"\"  Total Time: ",[1053,6692,6575],{"class":1684},[1053,6694,6695],{"class":1121},"total_time",[1053,6697,6673],{"class":1936},[1053,6699,6580],{"class":1684},[1053,6701,6652],{"class":1132},[1053,6703,1149],{"class":1083},[1053,6705,6706],{"class":1055,"line":2401},[1053,6707,1104],{"emptyLinePlaceholder":1103},[1053,6709,6710,6712,6716,6718,6720,6723,6725],{"class":1055,"line":2406},[1053,6711,6448],{"class":1066},[1053,6713,6715],{"class":6714},"s131V"," __name__",[1053,6717,1996],{"class":1532},[1053,6719,1485],{"class":1128},[1053,6721,6722],{"class":1132},"__main__",[1053,6724,1345],{"class":1128},[1053,6726,2006],{"class":1083},[1053,6728,6729,6732,6734,6737,6739,6742,6744,6746,6749,6751],{"class":1055,"line":2412},[1053,6730,6731],{"class":1070},"    asyncio",[1053,6733,1084],{"class":1083},[1053,6735,6736],{"class":1121},"run",[1053,6738,1125],{"class":1083},[1053,6740,6741],{"class":1121},"load_test",[1053,6743,1125],{"class":1083},[1053,6745,1345],{"class":1128},[1053,6747,6748],{"class":1132},"http://localhost:8000/",[1053,6750,1345],{"class":1128},[1053,6752,5591],{"class":1083},[1030,6754,6756],{"id":6755},"monitoring-and-health-checks","Monitoring and Health Checks",[1035,6758,6760],{"id":6759},"server-health-monitoring","Server Health Monitoring",[1043,6762,6764],{"className":1045,"code":6763,"language":1047,"meta":1048,"style":1048},"# monitoring/server_health.py\nimport psutil\nimport time\nfrom django.http import JsonResponse\nfrom django.views import View\n\nclass ServerHealthView(View):\n    \"\"\"Monitor server health metrics\"\"\"\n    \n    def get(self, request):\n        # System metrics\n        cpu_percent = psutil.cpu_percent(interval=1)\n        memory = psutil.virtual_memory()\n        disk = psutil.disk_usage('/')\n        \n        # Network metrics\n        network = psutil.net_io_counters()\n        \n        # Process metrics\n        process = psutil.Process()\n        process_memory = process.memory_info()\n        \n        # Load average (Unix only)\n        try:\n            load_avg = psutil.getloadavg()\n        except AttributeError:\n            load_avg = [0, 0, 0]\n        \n        health_data = {\n            'timestamp': time.time(),\n            'system': {\n                'cpu_percent': cpu_percent,\n                'memory_percent': memory.percent,\n                'memory_available': memory.available,\n                'disk_percent': (disk.used / disk.total) * 100,\n                'load_average': {\n                    '1min': load_avg[0],\n                    '5min': load_avg[1],\n                    '15min': load_avg[2],\n                }\n            },\n            'process': {\n                'memory_rss': process_memory.rss,\n                'memory_vms': process_memory.vms,\n                'cpu_percent': process.cpu_percent(),\n                'num_threads': process.num_threads(),\n            },\n            'network': {\n                'bytes_sent': network.bytes_sent,\n                'bytes_recv': network.bytes_recv,\n                'packets_sent': network.packets_sent,\n                'packets_recv': network.packets_recv,\n            }\n        }\n        \n        # Determine health status\n        status = 'healthy'\n        if cpu_percent > 90:\n            status = 'warning'\n        if memory.percent > 90:\n            status = 'critical'\n        \n        health_data['status'] = status\n        \n        return JsonResponse(health_data)\n",[1050,6765,6766,6771,6777,6783,6798,6814,6818,6834,6843,6847,6868,6873,6899,6914,6938,6942,6947,6963,6967,6972,6987,7002,7006,7011,7017,7033,7042,7063,7067,7076,7096,7109,7124,7143,7163,7203,7216,7237,7256,7276,7280,7285,7298,7318,7337,7355,7374,7378,7391,7411,7430,7449,7468,7472,7477,7481,7486,7500,7516,7530,7547,7560,7564,7584,7588],{"__ignoreMap":1048},[1053,6767,6768],{"class":1055,"line":1056},[1053,6769,6770],{"class":1059},"# monitoring/server_health.py\n",[1053,6772,6773,6775],{"class":1055,"line":1063},[1053,6774,1067],{"class":1066},[1053,6776,5480],{"class":1070},[1053,6778,6779,6781],{"class":1055,"line":1074},[1053,6780,1067],{"class":1066},[1053,6782,5876],{"class":1070},[1053,6784,6785,6787,6789,6791,6793,6795],{"class":1055,"line":1100},[1053,6786,1077],{"class":1066},[1053,6788,1080],{"class":1070},[1053,6790,1084],{"class":1083},[1053,6792,4314],{"class":1070},[1053,6794,1067],{"class":1066},[1053,6796,6797],{"class":1070}," JsonResponse\n",[1053,6799,6800,6802,6804,6806,6809,6811],{"class":1055,"line":1107},[1053,6801,1077],{"class":1066},[1053,6803,1080],{"class":1070},[1053,6805,1084],{"class":1083},[1053,6807,6808],{"class":1070},"views ",[1053,6810,1067],{"class":1066},[1053,6812,6813],{"class":1070}," View\n",[1053,6815,6816],{"class":1055,"line":1152},[1053,6817,1104],{"emptyLinePlaceholder":1103},[1053,6819,6820,6822,6826,6828,6832],{"class":1055,"line":1283},[1053,6821,3990],{"class":1936},[1053,6823,6825],{"class":6824},"sD-vU"," ServerHealthView",[1053,6827,1125],{"class":1083},[1053,6829,6831],{"class":6830},"sYn-s","View",[1053,6833,2470],{"class":1083},[1053,6835,6836,6838,6841],{"class":1055,"line":1288},[1053,6837,5138],{"class":5137},[1053,6839,6840],{"class":5141},"Monitor server health metrics",[1053,6842,5145],{"class":5137},[1053,6844,6845],{"class":1055,"line":1319},[1053,6846,5164],{"class":1070},[1053,6848,6849,6852,6855,6857,6861,6863,6866],{"class":1055,"line":1324},[1053,6850,6851],{"class":1936},"    def",[1053,6853,6854],{"class":1940}," get",[1053,6856,1125],{"class":1083},[1053,6858,6860],{"class":6859},"sRjD_","self",[1053,6862,1138],{"class":1083},[1053,6864,6865],{"class":2466}," request",[1053,6867,2470],{"class":1083},[1053,6869,6870],{"class":1055,"line":1336},[1053,6871,6872],{"class":1059},"        # System metrics\n",[1053,6874,6875,6878,6880,6882,6884,6887,6889,6893,6895,6897],{"class":1055,"line":1356},[1053,6876,6877],{"class":1070},"        cpu_percent ",[1053,6879,1158],{"class":1083},[1053,6881,5518],{"class":1070},[1053,6883,1084],{"class":1083},[1053,6885,6886],{"class":1121},"cpu_percent",[1053,6888,1125],{"class":1083},[1053,6890,6892],{"class":6891},"sqOPj","interval",[1053,6894,1158],{"class":1083},[1053,6896,6434],{"class":1501},[1053,6898,1149],{"class":1083},[1053,6900,6901,6904,6906,6908,6910,6912],{"class":1055,"line":1374},[1053,6902,6903],{"class":1070},"        memory ",[1053,6905,1158],{"class":1083},[1053,6907,5518],{"class":1070},[1053,6909,1084],{"class":1083},[1053,6911,5523],{"class":1121},[1053,6913,1164],{"class":1083},[1053,6915,6916,6919,6921,6923,6925,6928,6930,6932,6934,6936],{"class":1055,"line":1382},[1053,6917,6918],{"class":1070},"        disk ",[1053,6920,1158],{"class":1083},[1053,6922,5518],{"class":1070},[1053,6924,1084],{"class":1083},[1053,6926,6927],{"class":1121},"disk_usage",[1053,6929,1125],{"class":1083},[1053,6931,1129],{"class":1128},[1053,6933,5604],{"class":1132},[1053,6935,1129],{"class":1128},[1053,6937,1149],{"class":1083},[1053,6939,6940],{"class":1055,"line":1398},[1053,6941,6350],{"class":1070},[1053,6943,6944],{"class":1055,"line":1404},[1053,6945,6946],{"class":1059},"        # Network metrics\n",[1053,6948,6949,6952,6954,6956,6958,6961],{"class":1055,"line":1410},[1053,6950,6951],{"class":1070},"        network ",[1053,6953,1158],{"class":1083},[1053,6955,5518],{"class":1070},[1053,6957,1084],{"class":1083},[1053,6959,6960],{"class":1121},"net_io_counters",[1053,6962,1164],{"class":1083},[1053,6964,6965],{"class":1055,"line":1607},[1053,6966,6350],{"class":1070},[1053,6968,6969],{"class":1055,"line":1618},[1053,6970,6971],{"class":1059},"        # Process metrics\n",[1053,6973,6974,6977,6979,6981,6983,6985],{"class":1055,"line":1623},[1053,6975,6976],{"class":1070},"        process ",[1053,6978,1158],{"class":1083},[1053,6980,5518],{"class":1070},[1053,6982,1084],{"class":1083},[1053,6984,5749],{"class":1121},[1053,6986,1164],{"class":1083},[1053,6988,6989,6992,6994,6996,6998,7000],{"class":1055,"line":1629},[1053,6990,6991],{"class":1070},"        process_memory ",[1053,6993,1158],{"class":1083},[1053,6995,5761],{"class":1070},[1053,6997,1084],{"class":1083},[1053,6999,5766],{"class":1121},[1053,7001,1164],{"class":1083},[1053,7003,7004],{"class":1055,"line":1644},[1053,7005,6350],{"class":1070},[1053,7007,7008],{"class":1055,"line":1659},[1053,7009,7010],{"class":1059},"        # Load average (Unix only)\n",[1053,7012,7013,7015],{"class":1055,"line":1674},[1053,7014,5968],{"class":1066},[1053,7016,2006],{"class":1083},[1053,7018,7019,7022,7024,7026,7028,7031],{"class":1055,"line":1730},[1053,7020,7021],{"class":1070},"            load_avg ",[1053,7023,1158],{"class":1083},[1053,7025,5518],{"class":1070},[1053,7027,1084],{"class":1083},[1053,7029,7030],{"class":1121},"getloadavg",[1053,7032,1164],{"class":1083},[1053,7034,7035,7037,7040],{"class":1055,"line":1735},[1053,7036,6098],{"class":1066},[1053,7038,7039],{"class":5561}," AttributeError",[1053,7041,2006],{"class":1083},[1053,7043,7044,7046,7048,7050,7053,7055,7057,7059,7061],{"class":1055,"line":1741},[1053,7045,7021],{"class":1070},[1053,7047,1158],{"class":1083},[1053,7049,4139],{"class":1083},[1053,7051,7052],{"class":1501},"0",[1053,7054,1138],{"class":1083},[1053,7056,6129],{"class":1501},[1053,7058,1138],{"class":1083},[1053,7060,6129],{"class":1501},[1053,7062,1896],{"class":1083},[1053,7064,7065],{"class":1055,"line":1756},[1053,7066,6350],{"class":1070},[1053,7068,7069,7072,7074],{"class":1055,"line":1761},[1053,7070,7071],{"class":1070},"        health_data ",[1053,7073,1158],{"class":1083},[1053,7075,3782],{"class":1083},[1053,7077,7078,7081,7084,7086,7088,7090,7092,7094],{"class":1055,"line":1767},[1053,7079,7080],{"class":1128},"            '",[1053,7082,7083],{"class":1132},"timestamp",[1053,7085,1129],{"class":1128},[1053,7087,1171],{"class":1083},[1053,7089,5956],{"class":1070},[1053,7091,1084],{"class":1083},[1053,7093,5961],{"class":1121},[1053,7095,1353],{"class":1083},[1053,7097,7098,7100,7103,7105,7107],{"class":1055,"line":1779},[1053,7099,7080],{"class":1128},[1053,7101,7102],{"class":1132},"system",[1053,7104,1129],{"class":1128},[1053,7106,1171],{"class":1083},[1053,7108,3782],{"class":1083},[1053,7110,7111,7113,7115,7117,7119,7122],{"class":1055,"line":1794},[1053,7112,6120],{"class":1128},[1053,7114,6886],{"class":1132},[1053,7116,1129],{"class":1128},[1053,7118,1171],{"class":1083},[1053,7120,7121],{"class":1070}," cpu_percent",[1053,7123,1890],{"class":1083},[1053,7125,7126,7128,7130,7132,7134,7137,7139,7141],{"class":1055,"line":1809},[1053,7127,6120],{"class":1128},[1053,7129,5835],{"class":1132},[1053,7131,1129],{"class":1128},[1053,7133,1171],{"class":1083},[1053,7135,7136],{"class":1070}," memory",[1053,7138,1084],{"class":1083},[1053,7140,5824],{"class":1115},[1053,7142,1890],{"class":1083},[1053,7144,7145,7147,7150,7152,7154,7156,7158,7161],{"class":1055,"line":1823},[1053,7146,6120],{"class":1128},[1053,7148,7149],{"class":1132},"memory_available",[1053,7151,1129],{"class":1128},[1053,7153,1171],{"class":1083},[1053,7155,7136],{"class":1070},[1053,7157,1084],{"class":1083},[1053,7159,7160],{"class":1115},"available",[1053,7162,1890],{"class":1083},[1053,7164,7165,7167,7170,7172,7174,7176,7179,7181,7184,7186,7189,7191,7194,7196,7198,7201],{"class":1055,"line":1834},[1053,7166,6120],{"class":1128},[1053,7168,7169],{"class":1132},"disk_percent",[1053,7171,1129],{"class":1128},[1053,7173,1171],{"class":1083},[1053,7175,5653],{"class":1083},[1053,7177,7178],{"class":1070},"disk",[1053,7180,1084],{"class":1083},[1053,7182,7183],{"class":1115},"used",[1053,7185,6518],{"class":1532},[1053,7187,7188],{"class":1070}," disk",[1053,7190,1084],{"class":1083},[1053,7192,7193],{"class":1115},"total",[1053,7195,1993],{"class":1083},[1053,7197,1533],{"class":1532},[1053,7199,7200],{"class":1501}," 100",[1053,7202,1890],{"class":1083},[1053,7204,7205,7207,7210,7212,7214],{"class":1055,"line":1839},[1053,7206,6120],{"class":1128},[1053,7208,7209],{"class":1132},"load_average",[1053,7211,1129],{"class":1128},[1053,7213,1171],{"class":1083},[1053,7215,3782],{"class":1083},[1053,7217,7218,7220,7223,7225,7227,7230,7232,7234],{"class":1055,"line":1845},[1053,7219,6025],{"class":1128},[1053,7221,7222],{"class":1132},"1min",[1053,7224,1129],{"class":1128},[1053,7226,1171],{"class":1083},[1053,7228,7229],{"class":1070}," load_avg",[1053,7231,6454],{"class":1083},[1053,7233,7052],{"class":1501},[1053,7235,7236],{"class":1083},"],\n",[1053,7238,7239,7241,7244,7246,7248,7250,7252,7254],{"class":1055,"line":1851},[1053,7240,6025],{"class":1128},[1053,7242,7243],{"class":1132},"5min",[1053,7245,1129],{"class":1128},[1053,7247,1171],{"class":1083},[1053,7249,7229],{"class":1070},[1053,7251,6454],{"class":1083},[1053,7253,6434],{"class":1501},[1053,7255,7236],{"class":1083},[1053,7257,7258,7260,7263,7265,7267,7269,7271,7274],{"class":1055,"line":1857},[1053,7259,6025],{"class":1128},[1053,7261,7262],{"class":1132},"15min",[1053,7264,1129],{"class":1128},[1053,7266,1171],{"class":1083},[1053,7268,7229],{"class":1070},[1053,7270,6454],{"class":1083},[1053,7272,7273],{"class":1501},"2",[1053,7275,7236],{"class":1083},[1053,7277,7278],{"class":1055,"line":1862},[1053,7279,6093],{"class":1083},[1053,7281,7282],{"class":1055,"line":1868},[1053,7283,7284],{"class":1083},"            },\n",[1053,7286,7287,7289,7292,7294,7296],{"class":1055,"line":1879},[1053,7288,7080],{"class":1128},[1053,7290,7291],{"class":1132},"process",[1053,7293,1129],{"class":1128},[1053,7295,1171],{"class":1083},[1053,7297,3782],{"class":1083},[1053,7299,7300,7302,7305,7307,7309,7312,7314,7316],{"class":1055,"line":1893},[1053,7301,6120],{"class":1128},[1053,7303,7304],{"class":1132},"memory_rss",[1053,7306,1129],{"class":1128},[1053,7308,1171],{"class":1083},[1053,7310,7311],{"class":1070}," process_memory",[1053,7313,1084],{"class":1083},[1053,7315,5785],{"class":1115},[1053,7317,1890],{"class":1083},[1053,7319,7320,7322,7325,7327,7329,7331,7333,7335],{"class":1055,"line":2289},[1053,7321,6120],{"class":1128},[1053,7323,7324],{"class":1132},"memory_vms",[1053,7326,1129],{"class":1128},[1053,7328,1171],{"class":1083},[1053,7330,7311],{"class":1070},[1053,7332,1084],{"class":1083},[1053,7334,5805],{"class":1115},[1053,7336,1890],{"class":1083},[1053,7338,7339,7341,7343,7345,7347,7349,7351,7353],{"class":1055,"line":2295},[1053,7340,6120],{"class":1128},[1053,7342,6886],{"class":1132},[1053,7344,1129],{"class":1128},[1053,7346,1171],{"class":1083},[1053,7348,5761],{"class":1070},[1053,7350,1084],{"class":1083},[1053,7352,6886],{"class":1121},[1053,7354,1353],{"class":1083},[1053,7356,7357,7359,7362,7364,7366,7368,7370,7372],{"class":1055,"line":2305},[1053,7358,6120],{"class":1128},[1053,7360,7361],{"class":1132},"num_threads",[1053,7363,1129],{"class":1128},[1053,7365,1171],{"class":1083},[1053,7367,5761],{"class":1070},[1053,7369,1084],{"class":1083},[1053,7371,7361],{"class":1121},[1053,7373,1353],{"class":1083},[1053,7375,7376],{"class":1055,"line":2331},[1053,7377,7284],{"class":1083},[1053,7379,7380,7382,7385,7387,7389],{"class":1055,"line":2353},[1053,7381,7080],{"class":1128},[1053,7383,7384],{"class":1132},"network",[1053,7386,1129],{"class":1128},[1053,7388,1171],{"class":1083},[1053,7390,3782],{"class":1083},[1053,7392,7393,7395,7398,7400,7402,7405,7407,7409],{"class":1055,"line":2358},[1053,7394,6120],{"class":1128},[1053,7396,7397],{"class":1132},"bytes_sent",[1053,7399,1129],{"class":1128},[1053,7401,1171],{"class":1083},[1053,7403,7404],{"class":1070}," network",[1053,7406,1084],{"class":1083},[1053,7408,7397],{"class":1115},[1053,7410,1890],{"class":1083},[1053,7412,7413,7415,7418,7420,7422,7424,7426,7428],{"class":1055,"line":2363},[1053,7414,6120],{"class":1128},[1053,7416,7417],{"class":1132},"bytes_recv",[1053,7419,1129],{"class":1128},[1053,7421,1171],{"class":1083},[1053,7423,7404],{"class":1070},[1053,7425,1084],{"class":1083},[1053,7427,7417],{"class":1115},[1053,7429,1890],{"class":1083},[1053,7431,7432,7434,7437,7439,7441,7443,7445,7447],{"class":1055,"line":2369},[1053,7433,6120],{"class":1128},[1053,7435,7436],{"class":1132},"packets_sent",[1053,7438,1129],{"class":1128},[1053,7440,1171],{"class":1083},[1053,7442,7404],{"class":1070},[1053,7444,1084],{"class":1083},[1053,7446,7436],{"class":1115},[1053,7448,1890],{"class":1083},[1053,7450,7451,7453,7456,7458,7460,7462,7464,7466],{"class":1055,"line":2380},[1053,7452,6120],{"class":1128},[1053,7454,7455],{"class":1132},"packets_recv",[1053,7457,1129],{"class":1128},[1053,7459,1171],{"class":1083},[1053,7461,7404],{"class":1070},[1053,7463,1084],{"class":1083},[1053,7465,7455],{"class":1115},[1053,7467,1890],{"class":1083},[1053,7469,7470],{"class":1055,"line":2390},[1053,7471,6195],{"class":1083},[1053,7473,7474],{"class":1055,"line":2401},[1053,7475,7476],{"class":1083},"        }\n",[1053,7478,7479],{"class":1055,"line":2406},[1053,7480,6350],{"class":1070},[1053,7482,7483],{"class":1055,"line":2412},[1053,7484,7485],{"class":1059},"        # Determine health status\n",[1053,7487,7488,7491,7493,7495,7498],{"class":1055,"line":2430},[1053,7489,7490],{"class":1070},"        status ",[1053,7492,1158],{"class":1083},[1053,7494,1141],{"class":1128},[1053,7496,7497],{"class":1132},"healthy",[1053,7499,1727],{"class":1128},[1053,7501,7502,7505,7508,7511,7514],{"class":1055,"line":2445},[1053,7503,7504],{"class":1066},"        if",[1053,7506,7507],{"class":1070}," cpu_percent ",[1053,7509,7510],{"class":1532},">",[1053,7512,7513],{"class":1501}," 90",[1053,7515,2006],{"class":1083},[1053,7517,7518,7521,7523,7525,7528],{"class":1055,"line":2450},[1053,7519,7520],{"class":1070},"            status ",[1053,7522,1158],{"class":1083},[1053,7524,1141],{"class":1128},[1053,7526,7527],{"class":1132},"warning",[1053,7529,1727],{"class":1128},[1053,7531,7532,7534,7536,7538,7540,7543,7545],{"class":1055,"line":2456},[1053,7533,7504],{"class":1066},[1053,7535,7136],{"class":1070},[1053,7537,1084],{"class":1083},[1053,7539,5824],{"class":1115},[1053,7541,7542],{"class":1532}," >",[1053,7544,7513],{"class":1501},[1053,7546,2006],{"class":1083},[1053,7548,7549,7551,7553,7555,7558],{"class":1055,"line":2473},[1053,7550,7520],{"class":1070},[1053,7552,1158],{"class":1083},[1053,7554,1141],{"class":1128},[1053,7556,7557],{"class":1132},"critical",[1053,7559,1727],{"class":1128},[1053,7561,7562],{"class":1055,"line":2499},[1053,7563,6350],{"class":1070},[1053,7565,7566,7569,7571,7573,7575,7577,7579,7581],{"class":1055,"line":2504},[1053,7567,7568],{"class":1070},"        health_data",[1053,7570,6454],{"class":1083},[1053,7572,1129],{"class":1128},[1053,7574,6028],{"class":1132},[1053,7576,1129],{"class":1128},[1053,7578,6504],{"class":1083},[1053,7580,5444],{"class":1083},[1053,7582,7583],{"class":1070}," status\n",[1053,7585,7586],{"class":1055,"line":2518},[1053,7587,6350],{"class":1070},[1053,7589,7590,7592,7595,7597,7600],{"class":1055,"line":2542},[1053,7591,2011],{"class":1066},[1053,7593,7594],{"class":1121}," JsonResponse",[1053,7596,1125],{"class":1083},[1053,7598,7599],{"class":1121},"health_data",[1053,7601,1149],{"class":1083},[1026,7603,7604],{},"This comprehensive guide covers all major WSGI and ASGI servers for Django deployment, providing production-ready configurations and optimization strategies for different deployment scenarios.",[7606,7607,7608],"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 .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 .sftqT, html code.shiki .sftqT{--shiki-light:#90A4AE;--shiki-default:#393A34;--shiki-dark:#DBD7CAEE}html pre.shiki code .soVBu, html code.shiki .soVBu{--shiki-light:#39ADB5;--shiki-default:#999999;--shiki-dark:#666666}html pre.shiki code .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 .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 .s7CZa, html code.shiki .s7CZa{--shiki-light:#F76D47;--shiki-default:#2F798A;--shiki-dark:#4C9A91}html pre.shiki code .sVsLi, html code.shiki .sVsLi{--shiki-light:#39ADB5;--shiki-default:#AB5959;--shiki-dark:#CB7676}html pre.shiki code .s3h35, html code.shiki .s3h35{--shiki-light:#F76D47;--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 .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 .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 .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 .se3Ec, html code.shiki .se3Ec{--shiki-light:#90A4AE;--shiki-default:#A65E2B;--shiki-dark:#C99076}html pre.shiki code .sa2tF, html code.shiki .sa2tF{--shiki-light:#E2931D;--shiki-default:#998418;--shiki-dark:#B8A965}html pre.shiki code .sJdAF, html code.shiki .sJdAF{--shiki-light:#6182B8;--shiki-default:#998418;--shiki-dark:#B8A965}html pre.shiki code .s131V, html code.shiki .s131V{--shiki-light:#90A4AE;--shiki-default:#998418;--shiki-dark:#B8A965}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 .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}",{"title":1048,"searchDepth":1056,"depth":1063,"links":7610},[7611,7615,7620,7624,7629,7633,7638],{"id":1032,"depth":1063,"text":1033,"children":7612},[7613,7614],{"id":1037,"depth":1074,"text":1038},{"id":1190,"depth":1074,"text":1191},{"id":1435,"depth":1063,"text":1436,"children":7616},[7617,7618,7619],{"id":1442,"depth":1074,"text":1443},{"id":1899,"depth":1074,"text":1900},{"id":2756,"depth":1074,"text":2757},{"id":2993,"depth":1063,"text":2994,"children":7621},[7622,7623],{"id":3000,"depth":1074,"text":3001},{"id":3291,"depth":1074,"text":3292},{"id":3648,"depth":1063,"text":3649,"children":7625},[7626,7627,7628],{"id":3655,"depth":1074,"text":3656},{"id":4383,"depth":1074,"text":4384},{"id":4633,"depth":1074,"text":4634},{"id":4764,"depth":1063,"text":4765,"children":7630},[7631,7632],{"id":4771,"depth":1074,"text":4772},{"id":5023,"depth":1074,"text":5024},{"id":5092,"depth":1063,"text":5093,"children":7634},[7635,7636,7637],{"id":5096,"depth":1074,"text":5097},{"id":5462,"depth":1074,"text":5463},{"id":5844,"depth":1074,"text":5845},{"id":6755,"depth":1063,"text":6756,"children":7639},[7640],{"id":6759,"depth":1074,"text":6760},"md",null,{},{"title":747,"description":1028},"vDbQKypP3nkdRBriKvtzVZgDk5_YWZrDAMGMJxx65ak",[7647,7649],{"title":743,"path":744,"stem":745,"description":7648,"children":-1},"Transitioning a Django application from development to production requires systematic preparation across security, performance, configuration, and infrastructure. This chapter covers essential steps to ensure your application is production-ready, secure, and optimized for real-world usage.",{"title":751,"path":752,"stem":753,"description":7650,"children":-1},"Deploying Django applications on Linux servers provides maximum control, performance, and cost-effectiveness. This chapter covers comprehensive server setup, security hardening, service configuration, and deployment automation for Ubuntu, CentOS, and other Linux distributions.",1772474952913]