[{"data":1,"prerenderedAt":6323},["ShallowReactive",2],{"navigation":3,"/deployment/deploying-on-linux-servers":1016,"/deployment/deploying-on-linux-servers-surround":6318},[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":751,"body":1018,"description":1028,"extension":6313,"links":6314,"meta":6315,"navigation":1069,"path":752,"seo":6316,"stem":753,"__hash__":6317},"docs/20.deployment/04.deploying-on-linux-servers.md",{"type":1019,"value":1020,"toc":6287},"minimark",[1021,1025,1029,1034,1039,1669,1673,2504,2508,2512,2901,2905,3269,3273,3277,3909,3913,4109,4165,4169,4173,4534,4538,5071,5075,5167,5171,5175,5361,5364,5368,5640,5644,6280,6283],[1022,1023,751],"h1",{"id":1024},"deploying-on-linux-servers",[1026,1027,1028],"p",{},"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.",[1030,1031,1033],"h2",{"id":1032},"server-preparation-and-setup","Server Preparation and Setup",[1035,1036,1038],"h3",{"id":1037},"initial-server-configuration","Initial Server Configuration",[1040,1041,1046],"pre",{"className":1042,"code":1043,"language":1044,"meta":1045,"style":1045},"language-bash shiki shiki-themes material-theme-lighter vitesse-light vitesse-dark","#!/bin/bash\n# scripts/server_setup.sh - Initial server setup script\n\nset -e\n\n# Update system packages\necho \"🔄 Updating system packages...\"\napt update && apt upgrade -y\n\n# Install essential packages\necho \"📦 Installing essential packages...\"\napt install -y \\\n    curl \\\n    wget \\\n    git \\\n    vim \\\n    htop \\\n    unzip \\\n    software-properties-common \\\n    apt-transport-https \\\n    ca-certificates \\\n    gnupg \\\n    lsb-release \\\n    fail2ban \\\n    ufw \\\n    logrotate \\\n    supervisor\n\n# Install Python and development tools\necho \"🐍 Installing Python and development tools...\"\napt install -y \\\n    python3 \\\n    python3-pip \\\n    python3-venv \\\n    python3-dev \\\n    build-essential \\\n    libpq-dev \\\n    libjpeg-dev \\\n    libpng-dev \\\n    libfreetype6-dev \\\n    libxml2-dev \\\n    libxslt1-dev \\\n    libffi-dev \\\n    libssl-dev\n\n# Install database and cache servers\necho \"🗄️ Installing PostgreSQL and Redis...\"\napt install -y postgresql postgresql-contrib redis-server\n\n# Install web server\necho \"🌐 Installing Nginx...\"\napt install -y nginx\n\n# Create application user\necho \"👤 Creating application user...\"\nuseradd --system --shell /bin/bash --home /opt/django_app --create-home django\nusermod -a -G www-data django\n\n# Set up directory structure\necho \"📁 Setting up directory structure...\"\nmkdir -p /opt/django_app/{logs,static,media,backups}\nmkdir -p /var/log/{django,gunicorn,nginx}\nchown -R django:django /opt/django_app\nchown -R django:django /var/log/django\nchown -R django:django /var/log/gunicorn\n\necho \"✅ Server setup completed!\"\n","bash","",[1047,1048,1049,1058,1064,1071,1082,1087,1093,1110,1133,1138,1144,1156,1171,1179,1187,1195,1203,1211,1219,1227,1235,1243,1251,1259,1267,1275,1283,1289,1294,1300,1312,1323,1331,1339,1347,1355,1363,1371,1379,1387,1395,1403,1411,1419,1425,1430,1436,1448,1466,1471,1477,1489,1501,1506,1512,1524,1551,1568,1573,1579,1591,1603,1613,1628,1640,1652,1657],"code",{"__ignoreMap":1045},[1050,1051,1054],"span",{"class":1052,"line":1053},"line",1,[1050,1055,1057],{"class":1056},"s9Tkl","#!/bin/bash\n",[1050,1059,1061],{"class":1052,"line":1060},2,[1050,1062,1063],{"class":1056},"# scripts/server_setup.sh - Initial server setup script\n",[1050,1065,1067],{"class":1052,"line":1066},3,[1050,1068,1070],{"emptyLinePlaceholder":1069},true,"\n",[1050,1072,1074,1078],{"class":1052,"line":1073},4,[1050,1075,1077],{"class":1076},"sJdAF","set",[1050,1079,1081],{"class":1080},"sz9Cv"," -e\n",[1050,1083,1085],{"class":1052,"line":1084},5,[1050,1086,1070],{"emptyLinePlaceholder":1069},[1050,1088,1090],{"class":1052,"line":1089},6,[1050,1091,1092],{"class":1056},"# Update system packages\n",[1050,1094,1096,1099,1103,1107],{"class":1052,"line":1095},7,[1050,1097,1098],{"class":1076},"echo",[1050,1100,1102],{"class":1101},"sbYkP"," \"",[1050,1104,1106],{"class":1105},"sTbE_","🔄 Updating system packages...",[1050,1108,1109],{"class":1101},"\"\n",[1050,1111,1113,1117,1120,1124,1127,1130],{"class":1052,"line":1112},8,[1050,1114,1116],{"class":1115},"sYn-s","apt",[1050,1118,1119],{"class":1105}," update",[1050,1121,1123],{"class":1122},"soVBu"," &&",[1050,1125,1126],{"class":1115}," apt",[1050,1128,1129],{"class":1105}," upgrade",[1050,1131,1132],{"class":1080}," -y\n",[1050,1134,1136],{"class":1052,"line":1135},9,[1050,1137,1070],{"emptyLinePlaceholder":1069},[1050,1139,1141],{"class":1052,"line":1140},10,[1050,1142,1143],{"class":1056},"# Install essential packages\n",[1050,1145,1147,1149,1151,1154],{"class":1052,"line":1146},11,[1050,1148,1098],{"class":1076},[1050,1150,1102],{"class":1101},[1050,1152,1153],{"class":1105},"📦 Installing essential packages...",[1050,1155,1109],{"class":1101},[1050,1157,1159,1161,1164,1167],{"class":1052,"line":1158},12,[1050,1160,1116],{"class":1115},[1050,1162,1163],{"class":1105}," install",[1050,1165,1166],{"class":1080}," -y",[1050,1168,1170],{"class":1169},"se3Ec"," \\\n",[1050,1172,1174,1177],{"class":1052,"line":1173},13,[1050,1175,1176],{"class":1105},"    curl",[1050,1178,1170],{"class":1169},[1050,1180,1182,1185],{"class":1052,"line":1181},14,[1050,1183,1184],{"class":1105},"    wget",[1050,1186,1170],{"class":1169},[1050,1188,1190,1193],{"class":1052,"line":1189},15,[1050,1191,1192],{"class":1105},"    git",[1050,1194,1170],{"class":1169},[1050,1196,1198,1201],{"class":1052,"line":1197},16,[1050,1199,1200],{"class":1105},"    vim",[1050,1202,1170],{"class":1169},[1050,1204,1206,1209],{"class":1052,"line":1205},17,[1050,1207,1208],{"class":1105},"    htop",[1050,1210,1170],{"class":1169},[1050,1212,1214,1217],{"class":1052,"line":1213},18,[1050,1215,1216],{"class":1105},"    unzip",[1050,1218,1170],{"class":1169},[1050,1220,1222,1225],{"class":1052,"line":1221},19,[1050,1223,1224],{"class":1105},"    software-properties-common",[1050,1226,1170],{"class":1169},[1050,1228,1230,1233],{"class":1052,"line":1229},20,[1050,1231,1232],{"class":1105},"    apt-transport-https",[1050,1234,1170],{"class":1169},[1050,1236,1238,1241],{"class":1052,"line":1237},21,[1050,1239,1240],{"class":1105},"    ca-certificates",[1050,1242,1170],{"class":1169},[1050,1244,1246,1249],{"class":1052,"line":1245},22,[1050,1247,1248],{"class":1105},"    gnupg",[1050,1250,1170],{"class":1169},[1050,1252,1254,1257],{"class":1052,"line":1253},23,[1050,1255,1256],{"class":1105},"    lsb-release",[1050,1258,1170],{"class":1169},[1050,1260,1262,1265],{"class":1052,"line":1261},24,[1050,1263,1264],{"class":1105},"    fail2ban",[1050,1266,1170],{"class":1169},[1050,1268,1270,1273],{"class":1052,"line":1269},25,[1050,1271,1272],{"class":1105},"    ufw",[1050,1274,1170],{"class":1169},[1050,1276,1278,1281],{"class":1052,"line":1277},26,[1050,1279,1280],{"class":1105},"    logrotate",[1050,1282,1170],{"class":1169},[1050,1284,1286],{"class":1052,"line":1285},27,[1050,1287,1288],{"class":1105},"    supervisor\n",[1050,1290,1292],{"class":1052,"line":1291},28,[1050,1293,1070],{"emptyLinePlaceholder":1069},[1050,1295,1297],{"class":1052,"line":1296},29,[1050,1298,1299],{"class":1056},"# Install Python and development tools\n",[1050,1301,1303,1305,1307,1310],{"class":1052,"line":1302},30,[1050,1304,1098],{"class":1076},[1050,1306,1102],{"class":1101},[1050,1308,1309],{"class":1105},"🐍 Installing Python and development tools...",[1050,1311,1109],{"class":1101},[1050,1313,1315,1317,1319,1321],{"class":1052,"line":1314},31,[1050,1316,1116],{"class":1115},[1050,1318,1163],{"class":1105},[1050,1320,1166],{"class":1080},[1050,1322,1170],{"class":1169},[1050,1324,1326,1329],{"class":1052,"line":1325},32,[1050,1327,1328],{"class":1105},"    python3",[1050,1330,1170],{"class":1169},[1050,1332,1334,1337],{"class":1052,"line":1333},33,[1050,1335,1336],{"class":1105},"    python3-pip",[1050,1338,1170],{"class":1169},[1050,1340,1342,1345],{"class":1052,"line":1341},34,[1050,1343,1344],{"class":1105},"    python3-venv",[1050,1346,1170],{"class":1169},[1050,1348,1350,1353],{"class":1052,"line":1349},35,[1050,1351,1352],{"class":1105},"    python3-dev",[1050,1354,1170],{"class":1169},[1050,1356,1358,1361],{"class":1052,"line":1357},36,[1050,1359,1360],{"class":1105},"    build-essential",[1050,1362,1170],{"class":1169},[1050,1364,1366,1369],{"class":1052,"line":1365},37,[1050,1367,1368],{"class":1105},"    libpq-dev",[1050,1370,1170],{"class":1169},[1050,1372,1374,1377],{"class":1052,"line":1373},38,[1050,1375,1376],{"class":1105},"    libjpeg-dev",[1050,1378,1170],{"class":1169},[1050,1380,1382,1385],{"class":1052,"line":1381},39,[1050,1383,1384],{"class":1105},"    libpng-dev",[1050,1386,1170],{"class":1169},[1050,1388,1390,1393],{"class":1052,"line":1389},40,[1050,1391,1392],{"class":1105},"    libfreetype6-dev",[1050,1394,1170],{"class":1169},[1050,1396,1398,1401],{"class":1052,"line":1397},41,[1050,1399,1400],{"class":1105},"    libxml2-dev",[1050,1402,1170],{"class":1169},[1050,1404,1406,1409],{"class":1052,"line":1405},42,[1050,1407,1408],{"class":1105},"    libxslt1-dev",[1050,1410,1170],{"class":1169},[1050,1412,1414,1417],{"class":1052,"line":1413},43,[1050,1415,1416],{"class":1105},"    libffi-dev",[1050,1418,1170],{"class":1169},[1050,1420,1422],{"class":1052,"line":1421},44,[1050,1423,1424],{"class":1105},"    libssl-dev\n",[1050,1426,1428],{"class":1052,"line":1427},45,[1050,1429,1070],{"emptyLinePlaceholder":1069},[1050,1431,1433],{"class":1052,"line":1432},46,[1050,1434,1435],{"class":1056},"# Install database and cache servers\n",[1050,1437,1439,1441,1443,1446],{"class":1052,"line":1438},47,[1050,1440,1098],{"class":1076},[1050,1442,1102],{"class":1101},[1050,1444,1445],{"class":1105},"🗄️ Installing PostgreSQL and Redis...",[1050,1447,1109],{"class":1101},[1050,1449,1451,1453,1455,1457,1460,1463],{"class":1052,"line":1450},48,[1050,1452,1116],{"class":1115},[1050,1454,1163],{"class":1105},[1050,1456,1166],{"class":1080},[1050,1458,1459],{"class":1105}," postgresql",[1050,1461,1462],{"class":1105}," postgresql-contrib",[1050,1464,1465],{"class":1105}," redis-server\n",[1050,1467,1469],{"class":1052,"line":1468},49,[1050,1470,1070],{"emptyLinePlaceholder":1069},[1050,1472,1474],{"class":1052,"line":1473},50,[1050,1475,1476],{"class":1056},"# Install web server\n",[1050,1478,1480,1482,1484,1487],{"class":1052,"line":1479},51,[1050,1481,1098],{"class":1076},[1050,1483,1102],{"class":1101},[1050,1485,1486],{"class":1105},"🌐 Installing Nginx...",[1050,1488,1109],{"class":1101},[1050,1490,1492,1494,1496,1498],{"class":1052,"line":1491},52,[1050,1493,1116],{"class":1115},[1050,1495,1163],{"class":1105},[1050,1497,1166],{"class":1080},[1050,1499,1500],{"class":1105}," nginx\n",[1050,1502,1504],{"class":1052,"line":1503},53,[1050,1505,1070],{"emptyLinePlaceholder":1069},[1050,1507,1509],{"class":1052,"line":1508},54,[1050,1510,1511],{"class":1056},"# Create application user\n",[1050,1513,1515,1517,1519,1522],{"class":1052,"line":1514},55,[1050,1516,1098],{"class":1076},[1050,1518,1102],{"class":1101},[1050,1520,1521],{"class":1105},"👤 Creating application user...",[1050,1523,1109],{"class":1101},[1050,1525,1527,1530,1533,1536,1539,1542,1545,1548],{"class":1052,"line":1526},56,[1050,1528,1529],{"class":1115},"useradd",[1050,1531,1532],{"class":1080}," --system",[1050,1534,1535],{"class":1080}," --shell",[1050,1537,1538],{"class":1105}," /bin/bash",[1050,1540,1541],{"class":1080}," --home",[1050,1543,1544],{"class":1105}," /opt/django_app",[1050,1546,1547],{"class":1080}," --create-home",[1050,1549,1550],{"class":1105}," django\n",[1050,1552,1554,1557,1560,1563,1566],{"class":1052,"line":1553},57,[1050,1555,1556],{"class":1115},"usermod",[1050,1558,1559],{"class":1080}," -a",[1050,1561,1562],{"class":1080}," -G",[1050,1564,1565],{"class":1105}," www-data",[1050,1567,1550],{"class":1105},[1050,1569,1571],{"class":1052,"line":1570},58,[1050,1572,1070],{"emptyLinePlaceholder":1069},[1050,1574,1576],{"class":1052,"line":1575},59,[1050,1577,1578],{"class":1056},"# Set up directory structure\n",[1050,1580,1582,1584,1586,1589],{"class":1052,"line":1581},60,[1050,1583,1098],{"class":1076},[1050,1585,1102],{"class":1101},[1050,1587,1588],{"class":1105},"📁 Setting up directory structure...",[1050,1590,1109],{"class":1101},[1050,1592,1594,1597,1600],{"class":1052,"line":1593},61,[1050,1595,1596],{"class":1115},"mkdir",[1050,1598,1599],{"class":1080}," -p",[1050,1601,1602],{"class":1105}," /opt/django_app/{logs,static,media,backups}\n",[1050,1604,1606,1608,1610],{"class":1052,"line":1605},62,[1050,1607,1596],{"class":1115},[1050,1609,1599],{"class":1080},[1050,1611,1612],{"class":1105}," /var/log/{django,gunicorn,nginx}\n",[1050,1614,1616,1619,1622,1625],{"class":1052,"line":1615},63,[1050,1617,1618],{"class":1115},"chown",[1050,1620,1621],{"class":1080}," -R",[1050,1623,1624],{"class":1105}," django:django",[1050,1626,1627],{"class":1105}," /opt/django_app\n",[1050,1629,1631,1633,1635,1637],{"class":1052,"line":1630},64,[1050,1632,1618],{"class":1115},[1050,1634,1621],{"class":1080},[1050,1636,1624],{"class":1105},[1050,1638,1639],{"class":1105}," /var/log/django\n",[1050,1641,1643,1645,1647,1649],{"class":1052,"line":1642},65,[1050,1644,1618],{"class":1115},[1050,1646,1621],{"class":1080},[1050,1648,1624],{"class":1105},[1050,1650,1651],{"class":1105}," /var/log/gunicorn\n",[1050,1653,1655],{"class":1052,"line":1654},66,[1050,1656,1070],{"emptyLinePlaceholder":1069},[1050,1658,1660,1662,1664,1667],{"class":1052,"line":1659},67,[1050,1661,1098],{"class":1076},[1050,1663,1102],{"class":1101},[1050,1665,1666],{"class":1105},"✅ Server setup completed!",[1050,1668,1109],{"class":1101},[1035,1670,1672],{"id":1671},"security-hardening","Security Hardening",[1040,1674,1676],{"className":1042,"code":1675,"language":1044,"meta":1045,"style":1045},"#!/bin/bash\n# scripts/security_hardening.sh - Security hardening script\n\nset -e\n\necho \"🔒 Starting security hardening...\"\n\n# Configure firewall\necho \"🔥 Configuring UFW firewall...\"\nufw --force reset\nufw default deny incoming\nufw default allow outgoing\nufw allow ssh\nufw allow 80/tcp\nufw allow 443/tcp\nufw --force enable\n\n# Configure fail2ban\necho \"🛡️ Configuring fail2ban...\"\ncat > /etc/fail2ban/jail.local \u003C\u003C 'EOF'\n[DEFAULT]\nbantime = 3600\nfindtime = 600\nmaxretry = 3\nbackend = systemd\n\n[sshd]\nenabled = true\nport = ssh\nlogpath = %(sshd_log)s\nbackend = %(sshd_backend)s\n\n[nginx-http-auth]\nenabled = true\nfilter = nginx-http-auth\nlogpath = /var/log/nginx/error.log\nmaxretry = 6\n\n[nginx-limit-req]\nenabled = true\nfilter = nginx-limit-req\nlogpath = /var/log/nginx/error.log\nmaxretry = 10\n\n[django-auth]\nenabled = true\nfilter = django-auth\nlogpath = /var/log/django/django.log\nmaxretry = 5\nEOF\n\n# Create Django fail2ban filter\ncat > /etc/fail2ban/filter.d/django-auth.conf \u003C\u003C 'EOF'\n[Definition]\nfailregex = ^.*\\[.*\\] WARNING.*Invalid login attempt.*from \u003CHOST>\nignoreregex =\nEOF\n\n# Restart fail2ban\nsystemctl restart fail2ban\nsystemctl enable fail2ban\n\n# Configure SSH security\necho \"🔑 Hardening SSH configuration...\"\ncp /etc/ssh/sshd_config /etc/ssh/sshd_config.backup\n\ncat > /etc/ssh/sshd_config \u003C\u003C 'EOF'\nPort 22\nProtocol 2\nHostKey /etc/ssh/ssh_host_rsa_key\nHostKey /etc/ssh/ssh_host_ecdsa_key\nHostKey /etc/ssh/ssh_host_ed25519_key\n\nUsePrivilegeSeparation yes\nKeyRegenerationInterval 3600\nServerKeyBits 1024\n\nSyslogFacility AUTH\nLogLevel INFO\n\nLoginGraceTime 120\nPermitRootLogin no\nStrictModes yes\n\nRSAAuthentication yes\nPubkeyAuthentication yes\n\nIgnoreRhosts yes\nRhostsRSAAuthentication no\nHostbasedAuthentication no\n\nPermitEmptyPasswords no\nChallengeResponseAuthentication no\nPasswordAuthentication no\n\nX11Forwarding no\nX11DisplayOffset 10\nPrintMotd no\nPrintLastLog yes\nTCPKeepAlive yes\n\nAcceptEnv LANG LC_*\nSubsystem sftp /usr/lib/openssh/sftp-server\nUsePAM yes\n\nAllowUsers django\nMaxAuthTries 3\nClientAliveInterval 300\nClientAliveCountMax 2\nEOF\n\nsystemctl restart sshd\n\n# Set up automatic security updates\necho \"🔄 Configuring automatic security updates...\"\napt install -y unattended-upgrades\ncat > /etc/apt/apt.conf.d/50unattended-upgrades \u003C\u003C 'EOF'\nUnattended-Upgrade::Allowed-Origins {\n    \"${distro_id}:${distro_codename}-security\";\n    \"${distro_id}ESMApps:${distro_codename}-apps-security\";\n    \"${distro_id}ESM:${distro_codename}-infra-security\";\n};\n\nUnattended-Upgrade::Package-Blacklist {\n};\n\nUnattended-Upgrade::DevRelease \"false\";\nUnattended-Upgrade::Remove-Unused-Dependencies \"true\";\nUnattended-Upgrade::Automatic-Reboot \"false\";\nEOF\n\necho \"✅ Security hardening completed!\"\n",[1047,1677,1678,1682,1687,1691,1697,1701,1712,1716,1721,1732,1743,1756,1768,1777,1786,1795,1804,1808,1813,1824,1842,1847,1852,1857,1862,1867,1871,1876,1881,1886,1891,1896,1900,1905,1909,1914,1919,1924,1928,1933,1937,1942,1946,1951,1955,1960,1964,1969,1974,1979,1984,1988,1993,2006,2011,2016,2021,2025,2029,2034,2045,2054,2058,2063,2074,2085,2089,2101,2107,2113,2119,2125,2131,2136,2142,2148,2154,2159,2165,2171,2176,2182,2188,2194,2199,2205,2211,2216,2222,2228,2234,2239,2245,2251,2257,2262,2268,2274,2280,2286,2292,2297,2303,2309,2315,2320,2326,2332,2338,2344,2349,2354,2364,2369,2375,2387,2399,2413,2419,2425,2431,2437,2443,2448,2454,2459,2464,2470,2476,2482,2487,2492],{"__ignoreMap":1045},[1050,1679,1680],{"class":1052,"line":1053},[1050,1681,1057],{"class":1056},[1050,1683,1684],{"class":1052,"line":1060},[1050,1685,1686],{"class":1056},"# scripts/security_hardening.sh - Security hardening script\n",[1050,1688,1689],{"class":1052,"line":1066},[1050,1690,1070],{"emptyLinePlaceholder":1069},[1050,1692,1693,1695],{"class":1052,"line":1073},[1050,1694,1077],{"class":1076},[1050,1696,1081],{"class":1080},[1050,1698,1699],{"class":1052,"line":1084},[1050,1700,1070],{"emptyLinePlaceholder":1069},[1050,1702,1703,1705,1707,1710],{"class":1052,"line":1089},[1050,1704,1098],{"class":1076},[1050,1706,1102],{"class":1101},[1050,1708,1709],{"class":1105},"🔒 Starting security hardening...",[1050,1711,1109],{"class":1101},[1050,1713,1714],{"class":1052,"line":1095},[1050,1715,1070],{"emptyLinePlaceholder":1069},[1050,1717,1718],{"class":1052,"line":1112},[1050,1719,1720],{"class":1056},"# Configure firewall\n",[1050,1722,1723,1725,1727,1730],{"class":1052,"line":1135},[1050,1724,1098],{"class":1076},[1050,1726,1102],{"class":1101},[1050,1728,1729],{"class":1105},"🔥 Configuring UFW firewall...",[1050,1731,1109],{"class":1101},[1050,1733,1734,1737,1740],{"class":1052,"line":1140},[1050,1735,1736],{"class":1115},"ufw",[1050,1738,1739],{"class":1080}," --force",[1050,1741,1742],{"class":1105}," reset\n",[1050,1744,1745,1747,1750,1753],{"class":1052,"line":1146},[1050,1746,1736],{"class":1115},[1050,1748,1749],{"class":1105}," default",[1050,1751,1752],{"class":1105}," deny",[1050,1754,1755],{"class":1105}," incoming\n",[1050,1757,1758,1760,1762,1765],{"class":1052,"line":1158},[1050,1759,1736],{"class":1115},[1050,1761,1749],{"class":1105},[1050,1763,1764],{"class":1105}," allow",[1050,1766,1767],{"class":1105}," outgoing\n",[1050,1769,1770,1772,1774],{"class":1052,"line":1173},[1050,1771,1736],{"class":1115},[1050,1773,1764],{"class":1105},[1050,1775,1776],{"class":1105}," ssh\n",[1050,1778,1779,1781,1783],{"class":1052,"line":1181},[1050,1780,1736],{"class":1115},[1050,1782,1764],{"class":1105},[1050,1784,1785],{"class":1105}," 80/tcp\n",[1050,1787,1788,1790,1792],{"class":1052,"line":1189},[1050,1789,1736],{"class":1115},[1050,1791,1764],{"class":1105},[1050,1793,1794],{"class":1105}," 443/tcp\n",[1050,1796,1797,1799,1801],{"class":1052,"line":1197},[1050,1798,1736],{"class":1115},[1050,1800,1739],{"class":1080},[1050,1802,1803],{"class":1105}," enable\n",[1050,1805,1806],{"class":1052,"line":1205},[1050,1807,1070],{"emptyLinePlaceholder":1069},[1050,1809,1810],{"class":1052,"line":1213},[1050,1811,1812],{"class":1056},"# Configure fail2ban\n",[1050,1814,1815,1817,1819,1822],{"class":1052,"line":1221},[1050,1816,1098],{"class":1076},[1050,1818,1102],{"class":1101},[1050,1820,1821],{"class":1105},"🛡️ Configuring fail2ban...",[1050,1823,1109],{"class":1101},[1050,1825,1826,1829,1833,1836,1839],{"class":1052,"line":1229},[1050,1827,1828],{"class":1115},"cat",[1050,1830,1832],{"class":1831},"sVsLi"," >",[1050,1834,1835],{"class":1105}," /etc/fail2ban/jail.local",[1050,1837,1838],{"class":1831}," \u003C\u003C",[1050,1840,1841],{"class":1101}," 'EOF'\n",[1050,1843,1844],{"class":1052,"line":1237},[1050,1845,1846],{"class":1105},"[DEFAULT]\n",[1050,1848,1849],{"class":1052,"line":1245},[1050,1850,1851],{"class":1105},"bantime = 3600\n",[1050,1853,1854],{"class":1052,"line":1253},[1050,1855,1856],{"class":1105},"findtime = 600\n",[1050,1858,1859],{"class":1052,"line":1261},[1050,1860,1861],{"class":1105},"maxretry = 3\n",[1050,1863,1864],{"class":1052,"line":1269},[1050,1865,1866],{"class":1105},"backend = systemd\n",[1050,1868,1869],{"class":1052,"line":1277},[1050,1870,1070],{"emptyLinePlaceholder":1069},[1050,1872,1873],{"class":1052,"line":1285},[1050,1874,1875],{"class":1105},"[sshd]\n",[1050,1877,1878],{"class":1052,"line":1291},[1050,1879,1880],{"class":1105},"enabled = true\n",[1050,1882,1883],{"class":1052,"line":1296},[1050,1884,1885],{"class":1105},"port = ssh\n",[1050,1887,1888],{"class":1052,"line":1302},[1050,1889,1890],{"class":1105},"logpath = %(sshd_log)s\n",[1050,1892,1893],{"class":1052,"line":1314},[1050,1894,1895],{"class":1105},"backend = %(sshd_backend)s\n",[1050,1897,1898],{"class":1052,"line":1325},[1050,1899,1070],{"emptyLinePlaceholder":1069},[1050,1901,1902],{"class":1052,"line":1333},[1050,1903,1904],{"class":1105},"[nginx-http-auth]\n",[1050,1906,1907],{"class":1052,"line":1341},[1050,1908,1880],{"class":1105},[1050,1910,1911],{"class":1052,"line":1349},[1050,1912,1913],{"class":1105},"filter = nginx-http-auth\n",[1050,1915,1916],{"class":1052,"line":1357},[1050,1917,1918],{"class":1105},"logpath = /var/log/nginx/error.log\n",[1050,1920,1921],{"class":1052,"line":1365},[1050,1922,1923],{"class":1105},"maxretry = 6\n",[1050,1925,1926],{"class":1052,"line":1373},[1050,1927,1070],{"emptyLinePlaceholder":1069},[1050,1929,1930],{"class":1052,"line":1381},[1050,1931,1932],{"class":1105},"[nginx-limit-req]\n",[1050,1934,1935],{"class":1052,"line":1389},[1050,1936,1880],{"class":1105},[1050,1938,1939],{"class":1052,"line":1397},[1050,1940,1941],{"class":1105},"filter = nginx-limit-req\n",[1050,1943,1944],{"class":1052,"line":1405},[1050,1945,1918],{"class":1105},[1050,1947,1948],{"class":1052,"line":1413},[1050,1949,1950],{"class":1105},"maxretry = 10\n",[1050,1952,1953],{"class":1052,"line":1421},[1050,1954,1070],{"emptyLinePlaceholder":1069},[1050,1956,1957],{"class":1052,"line":1427},[1050,1958,1959],{"class":1105},"[django-auth]\n",[1050,1961,1962],{"class":1052,"line":1432},[1050,1963,1880],{"class":1105},[1050,1965,1966],{"class":1052,"line":1438},[1050,1967,1968],{"class":1105},"filter = django-auth\n",[1050,1970,1971],{"class":1052,"line":1450},[1050,1972,1973],{"class":1105},"logpath = /var/log/django/django.log\n",[1050,1975,1976],{"class":1052,"line":1468},[1050,1977,1978],{"class":1105},"maxretry = 5\n",[1050,1980,1981],{"class":1052,"line":1473},[1050,1982,1983],{"class":1101},"EOF\n",[1050,1985,1986],{"class":1052,"line":1479},[1050,1987,1070],{"emptyLinePlaceholder":1069},[1050,1989,1990],{"class":1052,"line":1491},[1050,1991,1992],{"class":1056},"# Create Django fail2ban filter\n",[1050,1994,1995,1997,1999,2002,2004],{"class":1052,"line":1503},[1050,1996,1828],{"class":1115},[1050,1998,1832],{"class":1831},[1050,2000,2001],{"class":1105}," /etc/fail2ban/filter.d/django-auth.conf",[1050,2003,1838],{"class":1831},[1050,2005,1841],{"class":1101},[1050,2007,2008],{"class":1052,"line":1508},[1050,2009,2010],{"class":1105},"[Definition]\n",[1050,2012,2013],{"class":1052,"line":1514},[1050,2014,2015],{"class":1105},"failregex = ^.*\\[.*\\] WARNING.*Invalid login attempt.*from \u003CHOST>\n",[1050,2017,2018],{"class":1052,"line":1526},[1050,2019,2020],{"class":1105},"ignoreregex =\n",[1050,2022,2023],{"class":1052,"line":1553},[1050,2024,1983],{"class":1101},[1050,2026,2027],{"class":1052,"line":1570},[1050,2028,1070],{"emptyLinePlaceholder":1069},[1050,2030,2031],{"class":1052,"line":1575},[1050,2032,2033],{"class":1056},"# Restart fail2ban\n",[1050,2035,2036,2039,2042],{"class":1052,"line":1581},[1050,2037,2038],{"class":1115},"systemctl",[1050,2040,2041],{"class":1105}," restart",[1050,2043,2044],{"class":1105}," fail2ban\n",[1050,2046,2047,2049,2052],{"class":1052,"line":1593},[1050,2048,2038],{"class":1115},[1050,2050,2051],{"class":1105}," enable",[1050,2053,2044],{"class":1105},[1050,2055,2056],{"class":1052,"line":1605},[1050,2057,1070],{"emptyLinePlaceholder":1069},[1050,2059,2060],{"class":1052,"line":1615},[1050,2061,2062],{"class":1056},"# Configure SSH security\n",[1050,2064,2065,2067,2069,2072],{"class":1052,"line":1630},[1050,2066,1098],{"class":1076},[1050,2068,1102],{"class":1101},[1050,2070,2071],{"class":1105},"🔑 Hardening SSH configuration...",[1050,2073,1109],{"class":1101},[1050,2075,2076,2079,2082],{"class":1052,"line":1642},[1050,2077,2078],{"class":1115},"cp",[1050,2080,2081],{"class":1105}," /etc/ssh/sshd_config",[1050,2083,2084],{"class":1105}," /etc/ssh/sshd_config.backup\n",[1050,2086,2087],{"class":1052,"line":1654},[1050,2088,1070],{"emptyLinePlaceholder":1069},[1050,2090,2091,2093,2095,2097,2099],{"class":1052,"line":1659},[1050,2092,1828],{"class":1115},[1050,2094,1832],{"class":1831},[1050,2096,2081],{"class":1105},[1050,2098,1838],{"class":1831},[1050,2100,1841],{"class":1101},[1050,2102,2104],{"class":1052,"line":2103},68,[1050,2105,2106],{"class":1105},"Port 22\n",[1050,2108,2110],{"class":1052,"line":2109},69,[1050,2111,2112],{"class":1105},"Protocol 2\n",[1050,2114,2116],{"class":1052,"line":2115},70,[1050,2117,2118],{"class":1105},"HostKey /etc/ssh/ssh_host_rsa_key\n",[1050,2120,2122],{"class":1052,"line":2121},71,[1050,2123,2124],{"class":1105},"HostKey /etc/ssh/ssh_host_ecdsa_key\n",[1050,2126,2128],{"class":1052,"line":2127},72,[1050,2129,2130],{"class":1105},"HostKey /etc/ssh/ssh_host_ed25519_key\n",[1050,2132,2134],{"class":1052,"line":2133},73,[1050,2135,1070],{"emptyLinePlaceholder":1069},[1050,2137,2139],{"class":1052,"line":2138},74,[1050,2140,2141],{"class":1105},"UsePrivilegeSeparation yes\n",[1050,2143,2145],{"class":1052,"line":2144},75,[1050,2146,2147],{"class":1105},"KeyRegenerationInterval 3600\n",[1050,2149,2151],{"class":1052,"line":2150},76,[1050,2152,2153],{"class":1105},"ServerKeyBits 1024\n",[1050,2155,2157],{"class":1052,"line":2156},77,[1050,2158,1070],{"emptyLinePlaceholder":1069},[1050,2160,2162],{"class":1052,"line":2161},78,[1050,2163,2164],{"class":1105},"SyslogFacility AUTH\n",[1050,2166,2168],{"class":1052,"line":2167},79,[1050,2169,2170],{"class":1105},"LogLevel INFO\n",[1050,2172,2174],{"class":1052,"line":2173},80,[1050,2175,1070],{"emptyLinePlaceholder":1069},[1050,2177,2179],{"class":1052,"line":2178},81,[1050,2180,2181],{"class":1105},"LoginGraceTime 120\n",[1050,2183,2185],{"class":1052,"line":2184},82,[1050,2186,2187],{"class":1105},"PermitRootLogin no\n",[1050,2189,2191],{"class":1052,"line":2190},83,[1050,2192,2193],{"class":1105},"StrictModes yes\n",[1050,2195,2197],{"class":1052,"line":2196},84,[1050,2198,1070],{"emptyLinePlaceholder":1069},[1050,2200,2202],{"class":1052,"line":2201},85,[1050,2203,2204],{"class":1105},"RSAAuthentication yes\n",[1050,2206,2208],{"class":1052,"line":2207},86,[1050,2209,2210],{"class":1105},"PubkeyAuthentication yes\n",[1050,2212,2214],{"class":1052,"line":2213},87,[1050,2215,1070],{"emptyLinePlaceholder":1069},[1050,2217,2219],{"class":1052,"line":2218},88,[1050,2220,2221],{"class":1105},"IgnoreRhosts yes\n",[1050,2223,2225],{"class":1052,"line":2224},89,[1050,2226,2227],{"class":1105},"RhostsRSAAuthentication no\n",[1050,2229,2231],{"class":1052,"line":2230},90,[1050,2232,2233],{"class":1105},"HostbasedAuthentication no\n",[1050,2235,2237],{"class":1052,"line":2236},91,[1050,2238,1070],{"emptyLinePlaceholder":1069},[1050,2240,2242],{"class":1052,"line":2241},92,[1050,2243,2244],{"class":1105},"PermitEmptyPasswords no\n",[1050,2246,2248],{"class":1052,"line":2247},93,[1050,2249,2250],{"class":1105},"ChallengeResponseAuthentication no\n",[1050,2252,2254],{"class":1052,"line":2253},94,[1050,2255,2256],{"class":1105},"PasswordAuthentication no\n",[1050,2258,2260],{"class":1052,"line":2259},95,[1050,2261,1070],{"emptyLinePlaceholder":1069},[1050,2263,2265],{"class":1052,"line":2264},96,[1050,2266,2267],{"class":1105},"X11Forwarding no\n",[1050,2269,2271],{"class":1052,"line":2270},97,[1050,2272,2273],{"class":1105},"X11DisplayOffset 10\n",[1050,2275,2277],{"class":1052,"line":2276},98,[1050,2278,2279],{"class":1105},"PrintMotd no\n",[1050,2281,2283],{"class":1052,"line":2282},99,[1050,2284,2285],{"class":1105},"PrintLastLog yes\n",[1050,2287,2289],{"class":1052,"line":2288},100,[1050,2290,2291],{"class":1105},"TCPKeepAlive yes\n",[1050,2293,2295],{"class":1052,"line":2294},101,[1050,2296,1070],{"emptyLinePlaceholder":1069},[1050,2298,2300],{"class":1052,"line":2299},102,[1050,2301,2302],{"class":1105},"AcceptEnv LANG LC_*\n",[1050,2304,2306],{"class":1052,"line":2305},103,[1050,2307,2308],{"class":1105},"Subsystem sftp /usr/lib/openssh/sftp-server\n",[1050,2310,2312],{"class":1052,"line":2311},104,[1050,2313,2314],{"class":1105},"UsePAM yes\n",[1050,2316,2318],{"class":1052,"line":2317},105,[1050,2319,1070],{"emptyLinePlaceholder":1069},[1050,2321,2323],{"class":1052,"line":2322},106,[1050,2324,2325],{"class":1105},"AllowUsers django\n",[1050,2327,2329],{"class":1052,"line":2328},107,[1050,2330,2331],{"class":1105},"MaxAuthTries 3\n",[1050,2333,2335],{"class":1052,"line":2334},108,[1050,2336,2337],{"class":1105},"ClientAliveInterval 300\n",[1050,2339,2341],{"class":1052,"line":2340},109,[1050,2342,2343],{"class":1105},"ClientAliveCountMax 2\n",[1050,2345,2347],{"class":1052,"line":2346},110,[1050,2348,1983],{"class":1101},[1050,2350,2352],{"class":1052,"line":2351},111,[1050,2353,1070],{"emptyLinePlaceholder":1069},[1050,2355,2357,2359,2361],{"class":1052,"line":2356},112,[1050,2358,2038],{"class":1115},[1050,2360,2041],{"class":1105},[1050,2362,2363],{"class":1105}," sshd\n",[1050,2365,2367],{"class":1052,"line":2366},113,[1050,2368,1070],{"emptyLinePlaceholder":1069},[1050,2370,2372],{"class":1052,"line":2371},114,[1050,2373,2374],{"class":1056},"# Set up automatic security updates\n",[1050,2376,2378,2380,2382,2385],{"class":1052,"line":2377},115,[1050,2379,1098],{"class":1076},[1050,2381,1102],{"class":1101},[1050,2383,2384],{"class":1105},"🔄 Configuring automatic security updates...",[1050,2386,1109],{"class":1101},[1050,2388,2390,2392,2394,2396],{"class":1052,"line":2389},116,[1050,2391,1116],{"class":1115},[1050,2393,1163],{"class":1105},[1050,2395,1166],{"class":1080},[1050,2397,2398],{"class":1105}," unattended-upgrades\n",[1050,2400,2402,2404,2406,2409,2411],{"class":1052,"line":2401},117,[1050,2403,1828],{"class":1115},[1050,2405,1832],{"class":1831},[1050,2407,2408],{"class":1105}," /etc/apt/apt.conf.d/50unattended-upgrades",[1050,2410,1838],{"class":1831},[1050,2412,1841],{"class":1101},[1050,2414,2416],{"class":1052,"line":2415},118,[1050,2417,2418],{"class":1105},"Unattended-Upgrade::Allowed-Origins {\n",[1050,2420,2422],{"class":1052,"line":2421},119,[1050,2423,2424],{"class":1105},"    \"${distro_id}:${distro_codename}-security\";\n",[1050,2426,2428],{"class":1052,"line":2427},120,[1050,2429,2430],{"class":1105},"    \"${distro_id}ESMApps:${distro_codename}-apps-security\";\n",[1050,2432,2434],{"class":1052,"line":2433},121,[1050,2435,2436],{"class":1105},"    \"${distro_id}ESM:${distro_codename}-infra-security\";\n",[1050,2438,2440],{"class":1052,"line":2439},122,[1050,2441,2442],{"class":1105},"};\n",[1050,2444,2446],{"class":1052,"line":2445},123,[1050,2447,1070],{"emptyLinePlaceholder":1069},[1050,2449,2451],{"class":1052,"line":2450},124,[1050,2452,2453],{"class":1105},"Unattended-Upgrade::Package-Blacklist {\n",[1050,2455,2457],{"class":1052,"line":2456},125,[1050,2458,2442],{"class":1105},[1050,2460,2462],{"class":1052,"line":2461},126,[1050,2463,1070],{"emptyLinePlaceholder":1069},[1050,2465,2467],{"class":1052,"line":2466},127,[1050,2468,2469],{"class":1105},"Unattended-Upgrade::DevRelease \"false\";\n",[1050,2471,2473],{"class":1052,"line":2472},128,[1050,2474,2475],{"class":1105},"Unattended-Upgrade::Remove-Unused-Dependencies \"true\";\n",[1050,2477,2479],{"class":1052,"line":2478},129,[1050,2480,2481],{"class":1105},"Unattended-Upgrade::Automatic-Reboot \"false\";\n",[1050,2483,2485],{"class":1052,"line":2484},130,[1050,2486,1983],{"class":1101},[1050,2488,2490],{"class":1052,"line":2489},131,[1050,2491,1070],{"emptyLinePlaceholder":1069},[1050,2493,2495,2497,2499,2502],{"class":1052,"line":2494},132,[1050,2496,1098],{"class":1076},[1050,2498,1102],{"class":1101},[1050,2500,2501],{"class":1105},"✅ Security hardening completed!",[1050,2503,1109],{"class":1101},[1030,2505,2507],{"id":2506},"database-setup-and-configuration","Database Setup and Configuration",[1035,2509,2511],{"id":2510},"postgresql-configuration","PostgreSQL Configuration",[1040,2513,2515],{"className":1042,"code":2514,"language":1044,"meta":1045,"style":1045},"#!/bin/bash\n# scripts/setup_postgresql.sh - PostgreSQL setup script\n\nset -e\n\necho \"🗄️ Setting up PostgreSQL...\"\n\n# Configure PostgreSQL\nsudo -u postgres psql \u003C\u003C 'EOF'\nCREATE USER django_user WITH PASSWORD 'secure_password_here';\nCREATE DATABASE django_app OWNER django_user;\nGRANT ALL PRIVILEGES ON DATABASE django_app TO django_user;\nALTER USER django_user CREATEDB;\n\\q\nEOF\n\n# Configure PostgreSQL for production\ncat > /etc/postgresql/*/main/postgresql.conf \u003C\u003C 'EOF'\n# Connection settings\nlisten_addresses = 'localhost'\nport = 5432\nmax_connections = 100\n\n# Memory settings\nshared_buffers = 256MB\neffective_cache_size = 1GB\nwork_mem = 4MB\nmaintenance_work_mem = 64MB\n\n# Checkpoint settings\ncheckpoint_completion_target = 0.9\nwal_buffers = 16MB\ndefault_statistics_target = 100\n\n# Logging\nlog_destination = 'stderr'\nlogging_collector = on\nlog_directory = 'pg_log'\nlog_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'\nlog_rotation_age = 1d\nlog_rotation_size = 100MB\nlog_min_duration_statement = 1000\nlog_line_prefix = '%t [%p]: [%l-1] user=%u,db=%d,app=%a,client=%h '\nlog_checkpoints = on\nlog_connections = on\nlog_disconnections = on\nlog_lock_waits = on\n\n# Performance\nrandom_page_cost = 1.1\neffective_io_concurrency = 200\nEOF\n\n# Configure pg_hba.conf for security\ncat > /etc/postgresql/*/main/pg_hba.conf \u003C\u003C 'EOF'\n# TYPE  DATABASE        USER            ADDRESS                 METHOD\nlocal   all             postgres                                peer\nlocal   all             all                                     peer\nhost    all             all             127.0.0.1/32            md5\nhost    all             all             ::1/128                 md5\nhost    django_app      django_user     127.0.0.1/32            md5\nEOF\n\n# Restart PostgreSQL\nsystemctl restart postgresql\nsystemctl enable postgresql\n\necho \"✅ PostgreSQL setup completed!\"\n",[1047,2516,2517,2521,2526,2530,2536,2540,2551,2555,2560,2578,2583,2588,2593,2598,2603,2607,2611,2616,2635,2640,2645,2650,2655,2659,2664,2669,2674,2679,2684,2688,2693,2698,2703,2708,2712,2717,2722,2727,2732,2737,2742,2747,2752,2757,2762,2767,2772,2777,2781,2786,2791,2796,2800,2804,2809,2826,2831,2836,2841,2846,2851,2856,2860,2864,2869,2878,2886,2890],{"__ignoreMap":1045},[1050,2518,2519],{"class":1052,"line":1053},[1050,2520,1057],{"class":1056},[1050,2522,2523],{"class":1052,"line":1060},[1050,2524,2525],{"class":1056},"# scripts/setup_postgresql.sh - PostgreSQL setup script\n",[1050,2527,2528],{"class":1052,"line":1066},[1050,2529,1070],{"emptyLinePlaceholder":1069},[1050,2531,2532,2534],{"class":1052,"line":1073},[1050,2533,1077],{"class":1076},[1050,2535,1081],{"class":1080},[1050,2537,2538],{"class":1052,"line":1084},[1050,2539,1070],{"emptyLinePlaceholder":1069},[1050,2541,2542,2544,2546,2549],{"class":1052,"line":1089},[1050,2543,1098],{"class":1076},[1050,2545,1102],{"class":1101},[1050,2547,2548],{"class":1105},"🗄️ Setting up PostgreSQL...",[1050,2550,1109],{"class":1101},[1050,2552,2553],{"class":1052,"line":1095},[1050,2554,1070],{"emptyLinePlaceholder":1069},[1050,2556,2557],{"class":1052,"line":1112},[1050,2558,2559],{"class":1056},"# Configure PostgreSQL\n",[1050,2561,2562,2565,2568,2571,2574,2576],{"class":1052,"line":1135},[1050,2563,2564],{"class":1115},"sudo",[1050,2566,2567],{"class":1080}," -u",[1050,2569,2570],{"class":1105}," postgres",[1050,2572,2573],{"class":1105}," psql",[1050,2575,1838],{"class":1831},[1050,2577,1841],{"class":1101},[1050,2579,2580],{"class":1052,"line":1140},[1050,2581,2582],{"class":1105},"CREATE USER django_user WITH PASSWORD 'secure_password_here';\n",[1050,2584,2585],{"class":1052,"line":1146},[1050,2586,2587],{"class":1105},"CREATE DATABASE django_app OWNER django_user;\n",[1050,2589,2590],{"class":1052,"line":1158},[1050,2591,2592],{"class":1105},"GRANT ALL PRIVILEGES ON DATABASE django_app TO django_user;\n",[1050,2594,2595],{"class":1052,"line":1173},[1050,2596,2597],{"class":1105},"ALTER USER django_user CREATEDB;\n",[1050,2599,2600],{"class":1052,"line":1181},[1050,2601,2602],{"class":1105},"\\q\n",[1050,2604,2605],{"class":1052,"line":1189},[1050,2606,1983],{"class":1101},[1050,2608,2609],{"class":1052,"line":1197},[1050,2610,1070],{"emptyLinePlaceholder":1069},[1050,2612,2613],{"class":1052,"line":1205},[1050,2614,2615],{"class":1056},"# Configure PostgreSQL for production\n",[1050,2617,2618,2620,2622,2625,2628,2631,2633],{"class":1052,"line":1213},[1050,2619,1828],{"class":1115},[1050,2621,1832],{"class":1831},[1050,2623,2624],{"class":1105}," /etc/postgresql/",[1050,2626,2627],{"class":1169},"*",[1050,2629,2630],{"class":1105},"/main/postgresql.conf",[1050,2632,1838],{"class":1831},[1050,2634,1841],{"class":1101},[1050,2636,2637],{"class":1052,"line":1221},[1050,2638,2639],{"class":1105},"# Connection settings\n",[1050,2641,2642],{"class":1052,"line":1229},[1050,2643,2644],{"class":1105},"listen_addresses = 'localhost'\n",[1050,2646,2647],{"class":1052,"line":1237},[1050,2648,2649],{"class":1105},"port = 5432\n",[1050,2651,2652],{"class":1052,"line":1245},[1050,2653,2654],{"class":1105},"max_connections = 100\n",[1050,2656,2657],{"class":1052,"line":1253},[1050,2658,1070],{"emptyLinePlaceholder":1069},[1050,2660,2661],{"class":1052,"line":1261},[1050,2662,2663],{"class":1105},"# Memory settings\n",[1050,2665,2666],{"class":1052,"line":1269},[1050,2667,2668],{"class":1105},"shared_buffers = 256MB\n",[1050,2670,2671],{"class":1052,"line":1277},[1050,2672,2673],{"class":1105},"effective_cache_size = 1GB\n",[1050,2675,2676],{"class":1052,"line":1285},[1050,2677,2678],{"class":1105},"work_mem = 4MB\n",[1050,2680,2681],{"class":1052,"line":1291},[1050,2682,2683],{"class":1105},"maintenance_work_mem = 64MB\n",[1050,2685,2686],{"class":1052,"line":1296},[1050,2687,1070],{"emptyLinePlaceholder":1069},[1050,2689,2690],{"class":1052,"line":1302},[1050,2691,2692],{"class":1105},"# Checkpoint settings\n",[1050,2694,2695],{"class":1052,"line":1314},[1050,2696,2697],{"class":1105},"checkpoint_completion_target = 0.9\n",[1050,2699,2700],{"class":1052,"line":1325},[1050,2701,2702],{"class":1105},"wal_buffers = 16MB\n",[1050,2704,2705],{"class":1052,"line":1333},[1050,2706,2707],{"class":1105},"default_statistics_target = 100\n",[1050,2709,2710],{"class":1052,"line":1341},[1050,2711,1070],{"emptyLinePlaceholder":1069},[1050,2713,2714],{"class":1052,"line":1349},[1050,2715,2716],{"class":1105},"# Logging\n",[1050,2718,2719],{"class":1052,"line":1357},[1050,2720,2721],{"class":1105},"log_destination = 'stderr'\n",[1050,2723,2724],{"class":1052,"line":1365},[1050,2725,2726],{"class":1105},"logging_collector = on\n",[1050,2728,2729],{"class":1052,"line":1373},[1050,2730,2731],{"class":1105},"log_directory = 'pg_log'\n",[1050,2733,2734],{"class":1052,"line":1381},[1050,2735,2736],{"class":1105},"log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'\n",[1050,2738,2739],{"class":1052,"line":1389},[1050,2740,2741],{"class":1105},"log_rotation_age = 1d\n",[1050,2743,2744],{"class":1052,"line":1397},[1050,2745,2746],{"class":1105},"log_rotation_size = 100MB\n",[1050,2748,2749],{"class":1052,"line":1405},[1050,2750,2751],{"class":1105},"log_min_duration_statement = 1000\n",[1050,2753,2754],{"class":1052,"line":1413},[1050,2755,2756],{"class":1105},"log_line_prefix = '%t [%p]: [%l-1] user=%u,db=%d,app=%a,client=%h '\n",[1050,2758,2759],{"class":1052,"line":1421},[1050,2760,2761],{"class":1105},"log_checkpoints = on\n",[1050,2763,2764],{"class":1052,"line":1427},[1050,2765,2766],{"class":1105},"log_connections = on\n",[1050,2768,2769],{"class":1052,"line":1432},[1050,2770,2771],{"class":1105},"log_disconnections = on\n",[1050,2773,2774],{"class":1052,"line":1438},[1050,2775,2776],{"class":1105},"log_lock_waits = on\n",[1050,2778,2779],{"class":1052,"line":1450},[1050,2780,1070],{"emptyLinePlaceholder":1069},[1050,2782,2783],{"class":1052,"line":1468},[1050,2784,2785],{"class":1105},"# Performance\n",[1050,2787,2788],{"class":1052,"line":1473},[1050,2789,2790],{"class":1105},"random_page_cost = 1.1\n",[1050,2792,2793],{"class":1052,"line":1479},[1050,2794,2795],{"class":1105},"effective_io_concurrency = 200\n",[1050,2797,2798],{"class":1052,"line":1491},[1050,2799,1983],{"class":1101},[1050,2801,2802],{"class":1052,"line":1503},[1050,2803,1070],{"emptyLinePlaceholder":1069},[1050,2805,2806],{"class":1052,"line":1508},[1050,2807,2808],{"class":1056},"# Configure pg_hba.conf for security\n",[1050,2810,2811,2813,2815,2817,2819,2822,2824],{"class":1052,"line":1514},[1050,2812,1828],{"class":1115},[1050,2814,1832],{"class":1831},[1050,2816,2624],{"class":1105},[1050,2818,2627],{"class":1169},[1050,2820,2821],{"class":1105},"/main/pg_hba.conf",[1050,2823,1838],{"class":1831},[1050,2825,1841],{"class":1101},[1050,2827,2828],{"class":1052,"line":1526},[1050,2829,2830],{"class":1105},"# TYPE  DATABASE        USER            ADDRESS                 METHOD\n",[1050,2832,2833],{"class":1052,"line":1553},[1050,2834,2835],{"class":1105},"local   all             postgres                                peer\n",[1050,2837,2838],{"class":1052,"line":1570},[1050,2839,2840],{"class":1105},"local   all             all                                     peer\n",[1050,2842,2843],{"class":1052,"line":1575},[1050,2844,2845],{"class":1105},"host    all             all             127.0.0.1/32            md5\n",[1050,2847,2848],{"class":1052,"line":1581},[1050,2849,2850],{"class":1105},"host    all             all             ::1/128                 md5\n",[1050,2852,2853],{"class":1052,"line":1593},[1050,2854,2855],{"class":1105},"host    django_app      django_user     127.0.0.1/32            md5\n",[1050,2857,2858],{"class":1052,"line":1605},[1050,2859,1983],{"class":1101},[1050,2861,2862],{"class":1052,"line":1615},[1050,2863,1070],{"emptyLinePlaceholder":1069},[1050,2865,2866],{"class":1052,"line":1630},[1050,2867,2868],{"class":1056},"# Restart PostgreSQL\n",[1050,2870,2871,2873,2875],{"class":1052,"line":1642},[1050,2872,2038],{"class":1115},[1050,2874,2041],{"class":1105},[1050,2876,2877],{"class":1105}," postgresql\n",[1050,2879,2880,2882,2884],{"class":1052,"line":1654},[1050,2881,2038],{"class":1115},[1050,2883,2051],{"class":1105},[1050,2885,2877],{"class":1105},[1050,2887,2888],{"class":1052,"line":1659},[1050,2889,1070],{"emptyLinePlaceholder":1069},[1050,2891,2892,2894,2896,2899],{"class":1052,"line":2103},[1050,2893,1098],{"class":1076},[1050,2895,1102],{"class":1101},[1050,2897,2898],{"class":1105},"✅ PostgreSQL setup completed!",[1050,2900,1109],{"class":1101},[1035,2902,2904],{"id":2903},"redis-configuration","Redis Configuration",[1040,2906,2908],{"className":1042,"code":2907,"language":1044,"meta":1045,"style":1045},"#!/bin/bash\n# scripts/setup_redis.sh - Redis setup script\n\nset -e\n\necho \"🔴 Setting up Redis...\"\n\n# Configure Redis\ncat > /etc/redis/redis.conf \u003C\u003C 'EOF'\n# Network\nbind 127.0.0.1\nport 6379\ntimeout 300\ntcp-keepalive 60\n\n# General\ndaemonize yes\nsupervised systemd\npidfile /var/run/redis/redis-server.pid\nloglevel notice\nlogfile /var/log/redis/redis-server.log\ndatabases 16\n\n# Snapshotting\nsave 900 1\nsave 300 10\nsave 60 10000\nstop-writes-on-bgsave-error yes\nrdbcompression yes\nrdbchecksum yes\ndbfilename dump.rdb\ndir /var/lib/redis\n\n# Security\nrequirepass your_redis_password_here\nrename-command FLUSHDB \"\"\nrename-command FLUSHALL \"\"\nrename-command DEBUG \"\"\nrename-command CONFIG \"CONFIG_b835c3f8a5d9e7f2\"\n\n# Memory management\nmaxmemory 256mb\nmaxmemory-policy allkeys-lru\nmaxmemory-samples 5\n\n# Append only file\nappendonly yes\nappendfilename \"appendonly.aof\"\nappendfsync everysec\nno-appendfsync-on-rewrite no\nauto-aof-rewrite-percentage 100\nauto-aof-rewrite-min-size 64mb\n\n# Slow log\nslowlog-log-slower-than 10000\nslowlog-max-len 128\nEOF\n\n# Set proper permissions\nchown redis:redis /etc/redis/redis.conf\nchmod 640 /etc/redis/redis.conf\n\n# Restart Redis\nsystemctl restart redis-server\nsystemctl enable redis-server\n\necho \"✅ Redis setup completed!\"\n",[1047,2909,2910,2914,2919,2923,2929,2933,2944,2948,2953,2966,2971,2976,2981,2986,2991,2995,3000,3005,3010,3015,3020,3025,3030,3034,3039,3044,3049,3054,3059,3064,3069,3074,3079,3083,3088,3093,3098,3103,3108,3113,3117,3122,3127,3132,3137,3141,3146,3151,3156,3161,3166,3171,3176,3180,3185,3190,3195,3199,3203,3208,3218,3229,3233,3238,3246,3254,3258],{"__ignoreMap":1045},[1050,2911,2912],{"class":1052,"line":1053},[1050,2913,1057],{"class":1056},[1050,2915,2916],{"class":1052,"line":1060},[1050,2917,2918],{"class":1056},"# scripts/setup_redis.sh - Redis setup script\n",[1050,2920,2921],{"class":1052,"line":1066},[1050,2922,1070],{"emptyLinePlaceholder":1069},[1050,2924,2925,2927],{"class":1052,"line":1073},[1050,2926,1077],{"class":1076},[1050,2928,1081],{"class":1080},[1050,2930,2931],{"class":1052,"line":1084},[1050,2932,1070],{"emptyLinePlaceholder":1069},[1050,2934,2935,2937,2939,2942],{"class":1052,"line":1089},[1050,2936,1098],{"class":1076},[1050,2938,1102],{"class":1101},[1050,2940,2941],{"class":1105},"🔴 Setting up Redis...",[1050,2943,1109],{"class":1101},[1050,2945,2946],{"class":1052,"line":1095},[1050,2947,1070],{"emptyLinePlaceholder":1069},[1050,2949,2950],{"class":1052,"line":1112},[1050,2951,2952],{"class":1056},"# Configure Redis\n",[1050,2954,2955,2957,2959,2962,2964],{"class":1052,"line":1135},[1050,2956,1828],{"class":1115},[1050,2958,1832],{"class":1831},[1050,2960,2961],{"class":1105}," /etc/redis/redis.conf",[1050,2963,1838],{"class":1831},[1050,2965,1841],{"class":1101},[1050,2967,2968],{"class":1052,"line":1140},[1050,2969,2970],{"class":1105},"# Network\n",[1050,2972,2973],{"class":1052,"line":1146},[1050,2974,2975],{"class":1105},"bind 127.0.0.1\n",[1050,2977,2978],{"class":1052,"line":1158},[1050,2979,2980],{"class":1105},"port 6379\n",[1050,2982,2983],{"class":1052,"line":1173},[1050,2984,2985],{"class":1105},"timeout 300\n",[1050,2987,2988],{"class":1052,"line":1181},[1050,2989,2990],{"class":1105},"tcp-keepalive 60\n",[1050,2992,2993],{"class":1052,"line":1189},[1050,2994,1070],{"emptyLinePlaceholder":1069},[1050,2996,2997],{"class":1052,"line":1197},[1050,2998,2999],{"class":1105},"# General\n",[1050,3001,3002],{"class":1052,"line":1205},[1050,3003,3004],{"class":1105},"daemonize yes\n",[1050,3006,3007],{"class":1052,"line":1213},[1050,3008,3009],{"class":1105},"supervised systemd\n",[1050,3011,3012],{"class":1052,"line":1221},[1050,3013,3014],{"class":1105},"pidfile /var/run/redis/redis-server.pid\n",[1050,3016,3017],{"class":1052,"line":1229},[1050,3018,3019],{"class":1105},"loglevel notice\n",[1050,3021,3022],{"class":1052,"line":1237},[1050,3023,3024],{"class":1105},"logfile /var/log/redis/redis-server.log\n",[1050,3026,3027],{"class":1052,"line":1245},[1050,3028,3029],{"class":1105},"databases 16\n",[1050,3031,3032],{"class":1052,"line":1253},[1050,3033,1070],{"emptyLinePlaceholder":1069},[1050,3035,3036],{"class":1052,"line":1261},[1050,3037,3038],{"class":1105},"# Snapshotting\n",[1050,3040,3041],{"class":1052,"line":1269},[1050,3042,3043],{"class":1105},"save 900 1\n",[1050,3045,3046],{"class":1052,"line":1277},[1050,3047,3048],{"class":1105},"save 300 10\n",[1050,3050,3051],{"class":1052,"line":1285},[1050,3052,3053],{"class":1105},"save 60 10000\n",[1050,3055,3056],{"class":1052,"line":1291},[1050,3057,3058],{"class":1105},"stop-writes-on-bgsave-error yes\n",[1050,3060,3061],{"class":1052,"line":1296},[1050,3062,3063],{"class":1105},"rdbcompression yes\n",[1050,3065,3066],{"class":1052,"line":1302},[1050,3067,3068],{"class":1105},"rdbchecksum yes\n",[1050,3070,3071],{"class":1052,"line":1314},[1050,3072,3073],{"class":1105},"dbfilename dump.rdb\n",[1050,3075,3076],{"class":1052,"line":1325},[1050,3077,3078],{"class":1105},"dir /var/lib/redis\n",[1050,3080,3081],{"class":1052,"line":1333},[1050,3082,1070],{"emptyLinePlaceholder":1069},[1050,3084,3085],{"class":1052,"line":1341},[1050,3086,3087],{"class":1105},"# Security\n",[1050,3089,3090],{"class":1052,"line":1349},[1050,3091,3092],{"class":1105},"requirepass your_redis_password_here\n",[1050,3094,3095],{"class":1052,"line":1357},[1050,3096,3097],{"class":1105},"rename-command FLUSHDB \"\"\n",[1050,3099,3100],{"class":1052,"line":1365},[1050,3101,3102],{"class":1105},"rename-command FLUSHALL \"\"\n",[1050,3104,3105],{"class":1052,"line":1373},[1050,3106,3107],{"class":1105},"rename-command DEBUG \"\"\n",[1050,3109,3110],{"class":1052,"line":1381},[1050,3111,3112],{"class":1105},"rename-command CONFIG \"CONFIG_b835c3f8a5d9e7f2\"\n",[1050,3114,3115],{"class":1052,"line":1389},[1050,3116,1070],{"emptyLinePlaceholder":1069},[1050,3118,3119],{"class":1052,"line":1397},[1050,3120,3121],{"class":1105},"# Memory management\n",[1050,3123,3124],{"class":1052,"line":1405},[1050,3125,3126],{"class":1105},"maxmemory 256mb\n",[1050,3128,3129],{"class":1052,"line":1413},[1050,3130,3131],{"class":1105},"maxmemory-policy allkeys-lru\n",[1050,3133,3134],{"class":1052,"line":1421},[1050,3135,3136],{"class":1105},"maxmemory-samples 5\n",[1050,3138,3139],{"class":1052,"line":1427},[1050,3140,1070],{"emptyLinePlaceholder":1069},[1050,3142,3143],{"class":1052,"line":1432},[1050,3144,3145],{"class":1105},"# Append only file\n",[1050,3147,3148],{"class":1052,"line":1438},[1050,3149,3150],{"class":1105},"appendonly yes\n",[1050,3152,3153],{"class":1052,"line":1450},[1050,3154,3155],{"class":1105},"appendfilename \"appendonly.aof\"\n",[1050,3157,3158],{"class":1052,"line":1468},[1050,3159,3160],{"class":1105},"appendfsync everysec\n",[1050,3162,3163],{"class":1052,"line":1473},[1050,3164,3165],{"class":1105},"no-appendfsync-on-rewrite no\n",[1050,3167,3168],{"class":1052,"line":1479},[1050,3169,3170],{"class":1105},"auto-aof-rewrite-percentage 100\n",[1050,3172,3173],{"class":1052,"line":1491},[1050,3174,3175],{"class":1105},"auto-aof-rewrite-min-size 64mb\n",[1050,3177,3178],{"class":1052,"line":1503},[1050,3179,1070],{"emptyLinePlaceholder":1069},[1050,3181,3182],{"class":1052,"line":1508},[1050,3183,3184],{"class":1105},"# Slow log\n",[1050,3186,3187],{"class":1052,"line":1514},[1050,3188,3189],{"class":1105},"slowlog-log-slower-than 10000\n",[1050,3191,3192],{"class":1052,"line":1526},[1050,3193,3194],{"class":1105},"slowlog-max-len 128\n",[1050,3196,3197],{"class":1052,"line":1553},[1050,3198,1983],{"class":1101},[1050,3200,3201],{"class":1052,"line":1570},[1050,3202,1070],{"emptyLinePlaceholder":1069},[1050,3204,3205],{"class":1052,"line":1575},[1050,3206,3207],{"class":1056},"# Set proper permissions\n",[1050,3209,3210,3212,3215],{"class":1052,"line":1581},[1050,3211,1618],{"class":1115},[1050,3213,3214],{"class":1105}," redis:redis",[1050,3216,3217],{"class":1105}," /etc/redis/redis.conf\n",[1050,3219,3220,3223,3227],{"class":1052,"line":1593},[1050,3221,3222],{"class":1115},"chmod",[1050,3224,3226],{"class":3225},"s7CZa"," 640",[1050,3228,3217],{"class":1105},[1050,3230,3231],{"class":1052,"line":1605},[1050,3232,1070],{"emptyLinePlaceholder":1069},[1050,3234,3235],{"class":1052,"line":1615},[1050,3236,3237],{"class":1056},"# Restart Redis\n",[1050,3239,3240,3242,3244],{"class":1052,"line":1630},[1050,3241,2038],{"class":1115},[1050,3243,2041],{"class":1105},[1050,3245,1465],{"class":1105},[1050,3247,3248,3250,3252],{"class":1052,"line":1642},[1050,3249,2038],{"class":1115},[1050,3251,2051],{"class":1105},[1050,3253,1465],{"class":1105},[1050,3255,3256],{"class":1052,"line":1654},[1050,3257,1070],{"emptyLinePlaceholder":1069},[1050,3259,3260,3262,3264,3267],{"class":1052,"line":1659},[1050,3261,1098],{"class":1076},[1050,3263,1102],{"class":1101},[1050,3265,3266],{"class":1105},"✅ Redis setup completed!",[1050,3268,1109],{"class":1101},[1030,3270,3272],{"id":3271},"application-deployment","Application Deployment",[1035,3274,3276],{"id":3275},"deployment-script","Deployment Script",[1040,3278,3280],{"className":1042,"code":3279,"language":1044,"meta":1045,"style":1045},"#!/bin/bash\n# scripts/deploy.sh - Main deployment script\n\nset -e\n\n# Configuration\nAPP_NAME=\"django_app\"\nAPP_USER=\"django\"\nAPP_DIR=\"/opt/$APP_NAME\"\nREPO_URL=\"https://github.com/yourusername/your-django-app.git\"\nBRANCH=\"main\"\nPYTHON_VERSION=\"3.9\"\n\necho \"🚀 Starting deployment of $APP_NAME...\"\n\n# Switch to application user\nsudo -u $APP_USER bash \u003C\u003C EOF\nset -e\n\n# Navigate to application directory\ncd $APP_DIR\n\n# Backup current version if exists\nif [ -d \"src\" ]; then\n    echo \"📦 Creating backup of current version...\"\n    cp -r src src_backup_\\$(date +%Y%m%d_%H%M%S)\nfi\n\n# Clone or update repository\nif [ -d \"src\" ]; then\n    echo \"🔄 Updating repository...\"\n    cd src\n    git fetch origin\n    git reset --hard origin/$BRANCH\nelse\n    echo \"📥 Cloning repository...\"\n    git clone -b $BRANCH $REPO_URL src\n    cd src\nfi\n\n# Create virtual environment if it doesn't exist\nif [ ! -d \"../venv\" ]; then\n    echo \"🐍 Creating virtual environment...\"\n    python3 -m venv ../venv\nfi\n\n# Activate virtual environment\nsource ../venv/bin/activate\n\n# Upgrade pip\npip install --upgrade pip\n\n# Install dependencies\necho \"📦 Installing dependencies...\"\npip install -r requirements.txt\n\n# Run Django management commands\necho \"🔧 Running Django management commands...\"\npython manage.py collectstatic --noinput\npython manage.py migrate --noinput\n\n# Create superuser if it doesn't exist\npython manage.py shell \u003C\u003C 'PYTHON'\nfrom django.contrib.auth import get_user_model\nUser = get_user_model()\nif not User.objects.filter(username='admin').exists():\n    User.objects.create_superuser('admin', 'admin@example.com', 'secure_password_here')\n    print(\"Superuser created\")\nelse:\n    print(\"Superuser already exists\")\nPYTHON\n\n# Run deployment checks\npython manage.py check --deploy\n\necho \"✅ Application deployment completed!\"\nEOF\n\n# Restart services\necho \"🔄 Restarting services...\"\nsystemctl restart $APP_NAME\nsystemctl restart nginx\n\n# Run post-deployment checks\necho \"🔍 Running post-deployment checks...\"\nsleep 5\n\n# Check if application is responding\nif curl -f -s http://localhost:8000/health/ > /dev/null; then\n    echo \"✅ Application is responding correctly!\"\nelse\n    echo \"❌ Application health check failed!\"\n    exit 1\nfi\n\necho \"🎉 Deployment completed successfully!\"\n",[1047,3281,3282,3286,3291,3295,3301,3305,3310,3327,3341,3359,3373,3387,3401,3405,3421,3425,3430,3447,3452,3456,3461,3469,3473,3478,3483,3488,3499,3504,3508,3513,3517,3522,3527,3532,3540,3545,3550,3564,3568,3572,3576,3581,3586,3591,3596,3600,3604,3609,3614,3618,3623,3628,3632,3637,3642,3647,3651,3656,3661,3666,3671,3675,3680,3685,3690,3695,3700,3705,3710,3715,3720,3725,3729,3734,3739,3743,3748,3752,3756,3761,3772,3781,3789,3793,3798,3809,3817,3821,3826,3855,3867,3871,3882,3890,3894,3898],{"__ignoreMap":1045},[1050,3283,3284],{"class":1052,"line":1053},[1050,3285,1057],{"class":1056},[1050,3287,3288],{"class":1052,"line":1060},[1050,3289,3290],{"class":1056},"# scripts/deploy.sh - Main deployment script\n",[1050,3292,3293],{"class":1052,"line":1066},[1050,3294,1070],{"emptyLinePlaceholder":1069},[1050,3296,3297,3299],{"class":1052,"line":1073},[1050,3298,1077],{"class":1076},[1050,3300,1081],{"class":1080},[1050,3302,3303],{"class":1052,"line":1084},[1050,3304,1070],{"emptyLinePlaceholder":1069},[1050,3306,3307],{"class":1052,"line":1089},[1050,3308,3309],{"class":1056},"# Configuration\n",[1050,3311,3312,3316,3319,3322,3325],{"class":1052,"line":1095},[1050,3313,3315],{"class":3314},"sSC40","APP_NAME",[1050,3317,3318],{"class":1122},"=",[1050,3320,3321],{"class":1101},"\"",[1050,3323,3324],{"class":1105},"django_app",[1050,3326,1109],{"class":1101},[1050,3328,3329,3332,3334,3336,3339],{"class":1052,"line":1112},[1050,3330,3331],{"class":3314},"APP_USER",[1050,3333,3318],{"class":1122},[1050,3335,3321],{"class":1101},[1050,3337,3338],{"class":1105},"django",[1050,3340,1109],{"class":1101},[1050,3342,3343,3346,3348,3350,3353,3357],{"class":1052,"line":1135},[1050,3344,3345],{"class":3314},"APP_DIR",[1050,3347,3318],{"class":1122},[1050,3349,3321],{"class":1101},[1050,3351,3352],{"class":1105},"/opt/",[1050,3354,3356],{"class":3355},"su_V2","$APP_NAME",[1050,3358,1109],{"class":1101},[1050,3360,3361,3364,3366,3368,3371],{"class":1052,"line":1140},[1050,3362,3363],{"class":3314},"REPO_URL",[1050,3365,3318],{"class":1122},[1050,3367,3321],{"class":1101},[1050,3369,3370],{"class":1105},"https://github.com/yourusername/your-django-app.git",[1050,3372,1109],{"class":1101},[1050,3374,3375,3378,3380,3382,3385],{"class":1052,"line":1146},[1050,3376,3377],{"class":3314},"BRANCH",[1050,3379,3318],{"class":1122},[1050,3381,3321],{"class":1101},[1050,3383,3384],{"class":1105},"main",[1050,3386,1109],{"class":1101},[1050,3388,3389,3392,3394,3396,3399],{"class":1052,"line":1158},[1050,3390,3391],{"class":3314},"PYTHON_VERSION",[1050,3393,3318],{"class":1122},[1050,3395,3321],{"class":1101},[1050,3397,3398],{"class":1105},"3.9",[1050,3400,1109],{"class":1101},[1050,3402,3403],{"class":1052,"line":1173},[1050,3404,1070],{"emptyLinePlaceholder":1069},[1050,3406,3407,3409,3411,3414,3416,3419],{"class":1052,"line":1181},[1050,3408,1098],{"class":1076},[1050,3410,1102],{"class":1101},[1050,3412,3413],{"class":1105},"🚀 Starting deployment of ",[1050,3415,3356],{"class":3355},[1050,3417,3418],{"class":1105},"...",[1050,3420,1109],{"class":1101},[1050,3422,3423],{"class":1052,"line":1189},[1050,3424,1070],{"emptyLinePlaceholder":1069},[1050,3426,3427],{"class":1052,"line":1197},[1050,3428,3429],{"class":1056},"# Switch to application user\n",[1050,3431,3432,3434,3436,3439,3442,3444],{"class":1052,"line":1205},[1050,3433,2564],{"class":1115},[1050,3435,2567],{"class":1080},[1050,3437,3438],{"class":3314}," $APP_USER",[1050,3440,3441],{"class":1105}," bash",[1050,3443,1838],{"class":1831},[1050,3445,3446],{"class":1101}," EOF\n",[1050,3448,3449],{"class":1052,"line":1213},[1050,3450,3451],{"class":1105},"set -e\n",[1050,3453,3454],{"class":1052,"line":1221},[1050,3455,1070],{"emptyLinePlaceholder":1069},[1050,3457,3458],{"class":1052,"line":1229},[1050,3459,3460],{"class":1105},"# Navigate to application directory\n",[1050,3462,3463,3466],{"class":1052,"line":1237},[1050,3464,3465],{"class":1105},"cd ",[1050,3467,3468],{"class":3355},"$APP_DIR\n",[1050,3470,3471],{"class":1052,"line":1245},[1050,3472,1070],{"emptyLinePlaceholder":1069},[1050,3474,3475],{"class":1052,"line":1253},[1050,3476,3477],{"class":1105},"# Backup current version if exists\n",[1050,3479,3480],{"class":1052,"line":1261},[1050,3481,3482],{"class":1105},"if [ -d \"src\" ]; then\n",[1050,3484,3485],{"class":1052,"line":1269},[1050,3486,3487],{"class":1105},"    echo \"📦 Creating backup of current version...\"\n",[1050,3489,3490,3493,3496],{"class":1052,"line":1277},[1050,3491,3492],{"class":1105},"    cp -r src src_backup_",[1050,3494,3495],{"class":1169},"\\$",[1050,3497,3498],{"class":1105},"(date +%Y%m%d_%H%M%S)\n",[1050,3500,3501],{"class":1052,"line":1285},[1050,3502,3503],{"class":1105},"fi\n",[1050,3505,3506],{"class":1052,"line":1291},[1050,3507,1070],{"emptyLinePlaceholder":1069},[1050,3509,3510],{"class":1052,"line":1296},[1050,3511,3512],{"class":1105},"# Clone or update repository\n",[1050,3514,3515],{"class":1052,"line":1302},[1050,3516,3482],{"class":1105},[1050,3518,3519],{"class":1052,"line":1314},[1050,3520,3521],{"class":1105},"    echo \"🔄 Updating repository...\"\n",[1050,3523,3524],{"class":1052,"line":1325},[1050,3525,3526],{"class":1105},"    cd src\n",[1050,3528,3529],{"class":1052,"line":1333},[1050,3530,3531],{"class":1105},"    git fetch origin\n",[1050,3533,3534,3537],{"class":1052,"line":1341},[1050,3535,3536],{"class":1105},"    git reset --hard origin/",[1050,3538,3539],{"class":3355},"$BRANCH\n",[1050,3541,3542],{"class":1052,"line":1349},[1050,3543,3544],{"class":1105},"else\n",[1050,3546,3547],{"class":1052,"line":1357},[1050,3548,3549],{"class":1105},"    echo \"📥 Cloning repository...\"\n",[1050,3551,3552,3555,3558,3561],{"class":1052,"line":1365},[1050,3553,3554],{"class":1105},"    git clone -b ",[1050,3556,3557],{"class":3355},"$BRANCH",[1050,3559,3560],{"class":3355}," $REPO_URL",[1050,3562,3563],{"class":1105}," src\n",[1050,3565,3566],{"class":1052,"line":1373},[1050,3567,3526],{"class":1105},[1050,3569,3570],{"class":1052,"line":1381},[1050,3571,3503],{"class":1105},[1050,3573,3574],{"class":1052,"line":1389},[1050,3575,1070],{"emptyLinePlaceholder":1069},[1050,3577,3578],{"class":1052,"line":1397},[1050,3579,3580],{"class":1105},"# Create virtual environment if it doesn't exist\n",[1050,3582,3583],{"class":1052,"line":1405},[1050,3584,3585],{"class":1105},"if [ ! -d \"../venv\" ]; then\n",[1050,3587,3588],{"class":1052,"line":1413},[1050,3589,3590],{"class":1105},"    echo \"🐍 Creating virtual environment...\"\n",[1050,3592,3593],{"class":1052,"line":1421},[1050,3594,3595],{"class":1105},"    python3 -m venv ../venv\n",[1050,3597,3598],{"class":1052,"line":1427},[1050,3599,3503],{"class":1105},[1050,3601,3602],{"class":1052,"line":1432},[1050,3603,1070],{"emptyLinePlaceholder":1069},[1050,3605,3606],{"class":1052,"line":1438},[1050,3607,3608],{"class":1105},"# Activate virtual environment\n",[1050,3610,3611],{"class":1052,"line":1450},[1050,3612,3613],{"class":1105},"source ../venv/bin/activate\n",[1050,3615,3616],{"class":1052,"line":1468},[1050,3617,1070],{"emptyLinePlaceholder":1069},[1050,3619,3620],{"class":1052,"line":1473},[1050,3621,3622],{"class":1105},"# Upgrade pip\n",[1050,3624,3625],{"class":1052,"line":1479},[1050,3626,3627],{"class":1105},"pip install --upgrade pip\n",[1050,3629,3630],{"class":1052,"line":1491},[1050,3631,1070],{"emptyLinePlaceholder":1069},[1050,3633,3634],{"class":1052,"line":1503},[1050,3635,3636],{"class":1105},"# Install dependencies\n",[1050,3638,3639],{"class":1052,"line":1508},[1050,3640,3641],{"class":1105},"echo \"📦 Installing dependencies...\"\n",[1050,3643,3644],{"class":1052,"line":1514},[1050,3645,3646],{"class":1105},"pip install -r requirements.txt\n",[1050,3648,3649],{"class":1052,"line":1526},[1050,3650,1070],{"emptyLinePlaceholder":1069},[1050,3652,3653],{"class":1052,"line":1553},[1050,3654,3655],{"class":1105},"# Run Django management commands\n",[1050,3657,3658],{"class":1052,"line":1570},[1050,3659,3660],{"class":1105},"echo \"🔧 Running Django management commands...\"\n",[1050,3662,3663],{"class":1052,"line":1575},[1050,3664,3665],{"class":1105},"python manage.py collectstatic --noinput\n",[1050,3667,3668],{"class":1052,"line":1581},[1050,3669,3670],{"class":1105},"python manage.py migrate --noinput\n",[1050,3672,3673],{"class":1052,"line":1593},[1050,3674,1070],{"emptyLinePlaceholder":1069},[1050,3676,3677],{"class":1052,"line":1605},[1050,3678,3679],{"class":1105},"# Create superuser if it doesn't exist\n",[1050,3681,3682],{"class":1052,"line":1615},[1050,3683,3684],{"class":1105},"python manage.py shell \u003C\u003C 'PYTHON'\n",[1050,3686,3687],{"class":1052,"line":1630},[1050,3688,3689],{"class":1105},"from django.contrib.auth import get_user_model\n",[1050,3691,3692],{"class":1052,"line":1642},[1050,3693,3694],{"class":1105},"User = get_user_model()\n",[1050,3696,3697],{"class":1052,"line":1654},[1050,3698,3699],{"class":1105},"if not User.objects.filter(username='admin').exists():\n",[1050,3701,3702],{"class":1052,"line":1659},[1050,3703,3704],{"class":1105},"    User.objects.create_superuser('admin', 'admin@example.com', 'secure_password_here')\n",[1050,3706,3707],{"class":1052,"line":2103},[1050,3708,3709],{"class":1105},"    print(\"Superuser created\")\n",[1050,3711,3712],{"class":1052,"line":2109},[1050,3713,3714],{"class":1105},"else:\n",[1050,3716,3717],{"class":1052,"line":2115},[1050,3718,3719],{"class":1105},"    print(\"Superuser already exists\")\n",[1050,3721,3722],{"class":1052,"line":2121},[1050,3723,3724],{"class":1105},"PYTHON\n",[1050,3726,3727],{"class":1052,"line":2127},[1050,3728,1070],{"emptyLinePlaceholder":1069},[1050,3730,3731],{"class":1052,"line":2133},[1050,3732,3733],{"class":1105},"# Run deployment checks\n",[1050,3735,3736],{"class":1052,"line":2138},[1050,3737,3738],{"class":1105},"python manage.py check --deploy\n",[1050,3740,3741],{"class":1052,"line":2144},[1050,3742,1070],{"emptyLinePlaceholder":1069},[1050,3744,3745],{"class":1052,"line":2150},[1050,3746,3747],{"class":1105},"echo \"✅ Application deployment completed!\"\n",[1050,3749,3750],{"class":1052,"line":2156},[1050,3751,1983],{"class":1101},[1050,3753,3754],{"class":1052,"line":2161},[1050,3755,1070],{"emptyLinePlaceholder":1069},[1050,3757,3758],{"class":1052,"line":2167},[1050,3759,3760],{"class":1056},"# Restart services\n",[1050,3762,3763,3765,3767,3770],{"class":1052,"line":2173},[1050,3764,1098],{"class":1076},[1050,3766,1102],{"class":1101},[1050,3768,3769],{"class":1105},"🔄 Restarting services...",[1050,3771,1109],{"class":1101},[1050,3773,3774,3776,3778],{"class":1052,"line":2178},[1050,3775,2038],{"class":1115},[1050,3777,2041],{"class":1105},[1050,3779,3780],{"class":3314}," $APP_NAME\n",[1050,3782,3783,3785,3787],{"class":1052,"line":2184},[1050,3784,2038],{"class":1115},[1050,3786,2041],{"class":1105},[1050,3788,1500],{"class":1105},[1050,3790,3791],{"class":1052,"line":2190},[1050,3792,1070],{"emptyLinePlaceholder":1069},[1050,3794,3795],{"class":1052,"line":2196},[1050,3796,3797],{"class":1056},"# Run post-deployment checks\n",[1050,3799,3800,3802,3804,3807],{"class":1052,"line":2201},[1050,3801,1098],{"class":1076},[1050,3803,1102],{"class":1101},[1050,3805,3806],{"class":1105},"🔍 Running post-deployment checks...",[1050,3808,1109],{"class":1101},[1050,3810,3811,3814],{"class":1052,"line":2207},[1050,3812,3813],{"class":1115},"sleep",[1050,3815,3816],{"class":3225}," 5\n",[1050,3818,3819],{"class":1052,"line":2213},[1050,3820,1070],{"emptyLinePlaceholder":1069},[1050,3822,3823],{"class":1052,"line":2218},[1050,3824,3825],{"class":1056},"# Check if application is responding\n",[1050,3827,3828,3832,3835,3838,3841,3844,3846,3849,3852],{"class":1052,"line":2224},[1050,3829,3831],{"class":3830},"siDh9","if",[1050,3833,3834],{"class":1115}," curl",[1050,3836,3837],{"class":1080}," -f",[1050,3839,3840],{"class":1080}," -s",[1050,3842,3843],{"class":1105}," http://localhost:8000/health/",[1050,3845,1832],{"class":1831},[1050,3847,3848],{"class":1105}," /dev/null",[1050,3850,3851],{"class":1122},";",[1050,3853,3854],{"class":3830}," then\n",[1050,3856,3857,3860,3862,3865],{"class":1052,"line":2230},[1050,3858,3859],{"class":1076},"    echo",[1050,3861,1102],{"class":1101},[1050,3863,3864],{"class":1105},"✅ Application is responding correctly!",[1050,3866,1109],{"class":1101},[1050,3868,3869],{"class":1052,"line":2236},[1050,3870,3544],{"class":3830},[1050,3872,3873,3875,3877,3880],{"class":1052,"line":2241},[1050,3874,3859],{"class":1076},[1050,3876,1102],{"class":1101},[1050,3878,3879],{"class":1105},"❌ Application health check failed!",[1050,3881,1109],{"class":1101},[1050,3883,3884,3887],{"class":1052,"line":2247},[1050,3885,3886],{"class":1076},"    exit",[1050,3888,3889],{"class":3225}," 1\n",[1050,3891,3892],{"class":1052,"line":2253},[1050,3893,3503],{"class":3830},[1050,3895,3896],{"class":1052,"line":2259},[1050,3897,1070],{"emptyLinePlaceholder":1069},[1050,3899,3900,3902,3904,3907],{"class":1052,"line":2264},[1050,3901,1098],{"class":1076},[1050,3903,1102],{"class":1101},[1050,3905,3906],{"class":1105},"🎉 Deployment completed successfully!",[1050,3908,1109],{"class":1101},[1035,3910,3912],{"id":3911},"service-configuration","Service Configuration",[1040,3914,3918],{"className":3915,"code":3916,"language":3917,"meta":1045,"style":1045},"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 postgresql.service redis-server.service\n\n[Service]\nType=notify\nUser=django\nGroup=django\nRuntimeDirectory=gunicorn\nWorkingDirectory=/opt/django_app/src\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 /tmp\n\n# Resource limits\nLimitNOFILE=65536\nLimitNPROC=4096\n\n[Install]\nWantedBy=multi-user.target\n","ini",[1047,3919,3920,3925,3930,3935,3940,3945,3949,3954,3959,3964,3969,3974,3979,3984,3989,3994,3999,4004,4009,4014,4019,4024,4029,4033,4038,4043,4048,4052,4056,4061,4066,4071,4076,4080,4085,4090,4095,4099,4104],{"__ignoreMap":1045},[1050,3921,3922],{"class":1052,"line":1053},[1050,3923,3924],{},"# /etc/systemd/system/django_app.service\n",[1050,3926,3927],{"class":1052,"line":1060},[1050,3928,3929],{},"[Unit]\n",[1050,3931,3932],{"class":1052,"line":1066},[1050,3933,3934],{},"Description=Django App Gunicorn daemon\n",[1050,3936,3937],{"class":1052,"line":1073},[1050,3938,3939],{},"Requires=django_app.socket\n",[1050,3941,3942],{"class":1052,"line":1084},[1050,3943,3944],{},"After=network.target postgresql.service redis-server.service\n",[1050,3946,3947],{"class":1052,"line":1089},[1050,3948,1070],{"emptyLinePlaceholder":1069},[1050,3950,3951],{"class":1052,"line":1095},[1050,3952,3953],{},"[Service]\n",[1050,3955,3956],{"class":1052,"line":1112},[1050,3957,3958],{},"Type=notify\n",[1050,3960,3961],{"class":1052,"line":1135},[1050,3962,3963],{},"User=django\n",[1050,3965,3966],{"class":1052,"line":1140},[1050,3967,3968],{},"Group=django\n",[1050,3970,3971],{"class":1052,"line":1146},[1050,3972,3973],{},"RuntimeDirectory=gunicorn\n",[1050,3975,3976],{"class":1052,"line":1158},[1050,3977,3978],{},"WorkingDirectory=/opt/django_app/src\n",[1050,3980,3981],{"class":1052,"line":1173},[1050,3982,3983],{},"ExecStart=/opt/django_app/venv/bin/gunicorn \\\n",[1050,3985,3986],{"class":1052,"line":1181},[1050,3987,3988],{},"    --config /opt/django_app/gunicorn.conf.py \\\n",[1050,3990,3991],{"class":1052,"line":1189},[1050,3992,3993],{},"    --pid /run/gunicorn/django_app.pid \\\n",[1050,3995,3996],{"class":1052,"line":1197},[1050,3997,3998],{},"    myproject.wsgi:application\n",[1050,4000,4001],{"class":1052,"line":1205},[1050,4002,4003],{},"ExecReload=/bin/kill -s HUP $MAINPID\n",[1050,4005,4006],{"class":1052,"line":1213},[1050,4007,4008],{},"KillMode=mixed\n",[1050,4010,4011],{"class":1052,"line":1221},[1050,4012,4013],{},"TimeoutStopSec=5\n",[1050,4015,4016],{"class":1052,"line":1229},[1050,4017,4018],{},"PrivateTmp=true\n",[1050,4020,4021],{"class":1052,"line":1237},[1050,4022,4023],{},"Restart=on-failure\n",[1050,4025,4026],{"class":1052,"line":1245},[1050,4027,4028],{},"RestartSec=5\n",[1050,4030,4031],{"class":1052,"line":1253},[1050,4032,1070],{"emptyLinePlaceholder":1069},[1050,4034,4035],{"class":1052,"line":1261},[1050,4036,4037],{},"# Environment\n",[1050,4039,4040],{"class":1052,"line":1269},[1050,4041,4042],{},"Environment=DJANGO_SETTINGS_MODULE=myproject.settings.production\n",[1050,4044,4045],{"class":1052,"line":1277},[1050,4046,4047],{},"EnvironmentFile=/opt/django_app/.env\n",[1050,4049,4050],{"class":1052,"line":1285},[1050,4051,1070],{"emptyLinePlaceholder":1069},[1050,4053,4054],{"class":1052,"line":1291},[1050,4055,3087],{},[1050,4057,4058],{"class":1052,"line":1296},[1050,4059,4060],{},"NoNewPrivileges=yes\n",[1050,4062,4063],{"class":1052,"line":1302},[1050,4064,4065],{},"ProtectSystem=strict\n",[1050,4067,4068],{"class":1052,"line":1314},[1050,4069,4070],{},"ProtectHome=yes\n",[1050,4072,4073],{"class":1052,"line":1325},[1050,4074,4075],{},"ReadWritePaths=/opt/django_app /var/log/gunicorn /run/gunicorn /tmp\n",[1050,4077,4078],{"class":1052,"line":1333},[1050,4079,1070],{"emptyLinePlaceholder":1069},[1050,4081,4082],{"class":1052,"line":1341},[1050,4083,4084],{},"# Resource limits\n",[1050,4086,4087],{"class":1052,"line":1349},[1050,4088,4089],{},"LimitNOFILE=65536\n",[1050,4091,4092],{"class":1052,"line":1357},[1050,4093,4094],{},"LimitNPROC=4096\n",[1050,4096,4097],{"class":1052,"line":1365},[1050,4098,1070],{"emptyLinePlaceholder":1069},[1050,4100,4101],{"class":1052,"line":1373},[1050,4102,4103],{},"[Install]\n",[1050,4105,4106],{"class":1052,"line":1381},[1050,4107,4108],{},"WantedBy=multi-user.target\n",[1040,4110,4112],{"className":3915,"code":4111,"language":3917,"meta":1045,"style":1045},"# /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",[1047,4113,4114,4119,4123,4128,4132,4137,4142,4147,4152,4156,4160],{"__ignoreMap":1045},[1050,4115,4116],{"class":1052,"line":1053},[1050,4117,4118],{},"# /etc/systemd/system/django_app.socket\n",[1050,4120,4121],{"class":1052,"line":1060},[1050,4122,3929],{},[1050,4124,4125],{"class":1052,"line":1066},[1050,4126,4127],{},"Description=Django App Gunicorn socket\n",[1050,4129,4130],{"class":1052,"line":1073},[1050,4131,1070],{"emptyLinePlaceholder":1069},[1050,4133,4134],{"class":1052,"line":1084},[1050,4135,4136],{},"[Socket]\n",[1050,4138,4139],{"class":1052,"line":1089},[1050,4140,4141],{},"ListenStream=/run/gunicorn/django_app.sock\n",[1050,4143,4144],{"class":1052,"line":1095},[1050,4145,4146],{},"SocketUser=www-data\n",[1050,4148,4149],{"class":1052,"line":1112},[1050,4150,4151],{},"SocketMode=600\n",[1050,4153,4154],{"class":1052,"line":1135},[1050,4155,1070],{"emptyLinePlaceholder":1069},[1050,4157,4158],{"class":1052,"line":1140},[1050,4159,4103],{},[1050,4161,4162],{"class":1052,"line":1146},[1050,4163,4164],{},"WantedBy=sockets.target\n",[1030,4166,4168],{"id":4167},"nginx-configuration","Nginx Configuration",[1035,4170,4172],{"id":4171},"main-nginx-configuration","Main Nginx Configuration",[1040,4174,4178],{"className":4175,"code":4176,"language":4177,"meta":1045,"style":1045},"language-nginx shiki shiki-themes material-theme-lighter vitesse-light vitesse-dark","# /etc/nginx/nginx.conf\nuser www-data;\nworker_processes auto;\npid /run/nginx.pid;\ninclude /etc/nginx/modules-enabled/*.conf;\n\nevents {\n    worker_connections 1024;\n    use epoll;\n    multi_accept on;\n}\n\nhttp {\n    # Basic Settings\n    sendfile on;\n    tcp_nopush on;\n    tcp_nodelay on;\n    keepalive_timeout 65;\n    types_hash_max_size 2048;\n    server_tokens off;\n    \n    # MIME\n    include /etc/nginx/mime.types;\n    default_type application/octet-stream;\n    \n    # Logging\n    log_format main '$remote_addr - $remote_user [$time_local] \"$request\" '\n                   '$status $body_bytes_sent \"$http_referer\" '\n                   '\"$http_user_agent\" \"$http_x_forwarded_for\" '\n                   '$request_time $upstream_response_time';\n    \n    access_log /var/log/nginx/access.log main;\n    error_log /var/log/nginx/error.log warn;\n    \n    # Gzip Settings\n    gzip on;\n    gzip_vary on;\n    gzip_proxied any;\n    gzip_comp_level 6;\n    gzip_types\n        text/plain\n        text/css\n        text/xml\n        text/javascript\n        application/json\n        application/javascript\n        application/xml+rss\n        application/atom+xml\n        image/svg+xml;\n    \n    # Rate Limiting\n    limit_req_zone $binary_remote_addr zone=login:10m rate=5r/m;\n    limit_req_zone $binary_remote_addr zone=api:10m rate=100r/m;\n    limit_req_zone $binary_remote_addr zone=general:10m rate=200r/m;\n    \n    # Connection Limiting\n    limit_conn_zone $binary_remote_addr zone=conn_limit_per_ip:10m;\n    \n    # Buffer Sizes\n    client_body_buffer_size 128k;\n    client_max_body_size 10m;\n    client_header_buffer_size 1k;\n    large_client_header_buffers 4 4k;\n    \n    # Timeouts\n    client_body_timeout 12;\n    client_header_timeout 12;\n    send_timeout 10;\n    \n    # Include site configurations\n    include /etc/nginx/conf.d/*.conf;\n    include /etc/nginx/sites-enabled/*;\n}\n","nginx",[1047,4179,4180,4185,4190,4195,4200,4205,4209,4214,4219,4224,4229,4234,4238,4243,4248,4253,4258,4263,4268,4273,4278,4283,4288,4293,4298,4302,4307,4312,4317,4322,4327,4331,4336,4341,4345,4350,4355,4360,4365,4370,4375,4380,4385,4390,4395,4400,4405,4410,4415,4420,4424,4429,4434,4439,4444,4448,4453,4458,4462,4467,4472,4477,4482,4487,4491,4496,4501,4506,4511,4515,4520,4525,4530],{"__ignoreMap":1045},[1050,4181,4182],{"class":1052,"line":1053},[1050,4183,4184],{},"# /etc/nginx/nginx.conf\n",[1050,4186,4187],{"class":1052,"line":1060},[1050,4188,4189],{},"user www-data;\n",[1050,4191,4192],{"class":1052,"line":1066},[1050,4193,4194],{},"worker_processes auto;\n",[1050,4196,4197],{"class":1052,"line":1073},[1050,4198,4199],{},"pid /run/nginx.pid;\n",[1050,4201,4202],{"class":1052,"line":1084},[1050,4203,4204],{},"include /etc/nginx/modules-enabled/*.conf;\n",[1050,4206,4207],{"class":1052,"line":1089},[1050,4208,1070],{"emptyLinePlaceholder":1069},[1050,4210,4211],{"class":1052,"line":1095},[1050,4212,4213],{},"events {\n",[1050,4215,4216],{"class":1052,"line":1112},[1050,4217,4218],{},"    worker_connections 1024;\n",[1050,4220,4221],{"class":1052,"line":1135},[1050,4222,4223],{},"    use epoll;\n",[1050,4225,4226],{"class":1052,"line":1140},[1050,4227,4228],{},"    multi_accept on;\n",[1050,4230,4231],{"class":1052,"line":1146},[1050,4232,4233],{},"}\n",[1050,4235,4236],{"class":1052,"line":1158},[1050,4237,1070],{"emptyLinePlaceholder":1069},[1050,4239,4240],{"class":1052,"line":1173},[1050,4241,4242],{},"http {\n",[1050,4244,4245],{"class":1052,"line":1181},[1050,4246,4247],{},"    # Basic Settings\n",[1050,4249,4250],{"class":1052,"line":1189},[1050,4251,4252],{},"    sendfile on;\n",[1050,4254,4255],{"class":1052,"line":1197},[1050,4256,4257],{},"    tcp_nopush on;\n",[1050,4259,4260],{"class":1052,"line":1205},[1050,4261,4262],{},"    tcp_nodelay on;\n",[1050,4264,4265],{"class":1052,"line":1213},[1050,4266,4267],{},"    keepalive_timeout 65;\n",[1050,4269,4270],{"class":1052,"line":1221},[1050,4271,4272],{},"    types_hash_max_size 2048;\n",[1050,4274,4275],{"class":1052,"line":1229},[1050,4276,4277],{},"    server_tokens off;\n",[1050,4279,4280],{"class":1052,"line":1237},[1050,4281,4282],{},"    \n",[1050,4284,4285],{"class":1052,"line":1245},[1050,4286,4287],{},"    # MIME\n",[1050,4289,4290],{"class":1052,"line":1253},[1050,4291,4292],{},"    include /etc/nginx/mime.types;\n",[1050,4294,4295],{"class":1052,"line":1261},[1050,4296,4297],{},"    default_type application/octet-stream;\n",[1050,4299,4300],{"class":1052,"line":1269},[1050,4301,4282],{},[1050,4303,4304],{"class":1052,"line":1277},[1050,4305,4306],{},"    # Logging\n",[1050,4308,4309],{"class":1052,"line":1285},[1050,4310,4311],{},"    log_format main '$remote_addr - $remote_user [$time_local] \"$request\" '\n",[1050,4313,4314],{"class":1052,"line":1291},[1050,4315,4316],{},"                   '$status $body_bytes_sent \"$http_referer\" '\n",[1050,4318,4319],{"class":1052,"line":1296},[1050,4320,4321],{},"                   '\"$http_user_agent\" \"$http_x_forwarded_for\" '\n",[1050,4323,4324],{"class":1052,"line":1302},[1050,4325,4326],{},"                   '$request_time $upstream_response_time';\n",[1050,4328,4329],{"class":1052,"line":1314},[1050,4330,4282],{},[1050,4332,4333],{"class":1052,"line":1325},[1050,4334,4335],{},"    access_log /var/log/nginx/access.log main;\n",[1050,4337,4338],{"class":1052,"line":1333},[1050,4339,4340],{},"    error_log /var/log/nginx/error.log warn;\n",[1050,4342,4343],{"class":1052,"line":1341},[1050,4344,4282],{},[1050,4346,4347],{"class":1052,"line":1349},[1050,4348,4349],{},"    # Gzip Settings\n",[1050,4351,4352],{"class":1052,"line":1357},[1050,4353,4354],{},"    gzip on;\n",[1050,4356,4357],{"class":1052,"line":1365},[1050,4358,4359],{},"    gzip_vary on;\n",[1050,4361,4362],{"class":1052,"line":1373},[1050,4363,4364],{},"    gzip_proxied any;\n",[1050,4366,4367],{"class":1052,"line":1381},[1050,4368,4369],{},"    gzip_comp_level 6;\n",[1050,4371,4372],{"class":1052,"line":1389},[1050,4373,4374],{},"    gzip_types\n",[1050,4376,4377],{"class":1052,"line":1397},[1050,4378,4379],{},"        text/plain\n",[1050,4381,4382],{"class":1052,"line":1405},[1050,4383,4384],{},"        text/css\n",[1050,4386,4387],{"class":1052,"line":1413},[1050,4388,4389],{},"        text/xml\n",[1050,4391,4392],{"class":1052,"line":1421},[1050,4393,4394],{},"        text/javascript\n",[1050,4396,4397],{"class":1052,"line":1427},[1050,4398,4399],{},"        application/json\n",[1050,4401,4402],{"class":1052,"line":1432},[1050,4403,4404],{},"        application/javascript\n",[1050,4406,4407],{"class":1052,"line":1438},[1050,4408,4409],{},"        application/xml+rss\n",[1050,4411,4412],{"class":1052,"line":1450},[1050,4413,4414],{},"        application/atom+xml\n",[1050,4416,4417],{"class":1052,"line":1468},[1050,4418,4419],{},"        image/svg+xml;\n",[1050,4421,4422],{"class":1052,"line":1473},[1050,4423,4282],{},[1050,4425,4426],{"class":1052,"line":1479},[1050,4427,4428],{},"    # Rate Limiting\n",[1050,4430,4431],{"class":1052,"line":1491},[1050,4432,4433],{},"    limit_req_zone $binary_remote_addr zone=login:10m rate=5r/m;\n",[1050,4435,4436],{"class":1052,"line":1503},[1050,4437,4438],{},"    limit_req_zone $binary_remote_addr zone=api:10m rate=100r/m;\n",[1050,4440,4441],{"class":1052,"line":1508},[1050,4442,4443],{},"    limit_req_zone $binary_remote_addr zone=general:10m rate=200r/m;\n",[1050,4445,4446],{"class":1052,"line":1514},[1050,4447,4282],{},[1050,4449,4450],{"class":1052,"line":1526},[1050,4451,4452],{},"    # Connection Limiting\n",[1050,4454,4455],{"class":1052,"line":1553},[1050,4456,4457],{},"    limit_conn_zone $binary_remote_addr zone=conn_limit_per_ip:10m;\n",[1050,4459,4460],{"class":1052,"line":1570},[1050,4461,4282],{},[1050,4463,4464],{"class":1052,"line":1575},[1050,4465,4466],{},"    # Buffer Sizes\n",[1050,4468,4469],{"class":1052,"line":1581},[1050,4470,4471],{},"    client_body_buffer_size 128k;\n",[1050,4473,4474],{"class":1052,"line":1593},[1050,4475,4476],{},"    client_max_body_size 10m;\n",[1050,4478,4479],{"class":1052,"line":1605},[1050,4480,4481],{},"    client_header_buffer_size 1k;\n",[1050,4483,4484],{"class":1052,"line":1615},[1050,4485,4486],{},"    large_client_header_buffers 4 4k;\n",[1050,4488,4489],{"class":1052,"line":1630},[1050,4490,4282],{},[1050,4492,4493],{"class":1052,"line":1642},[1050,4494,4495],{},"    # Timeouts\n",[1050,4497,4498],{"class":1052,"line":1654},[1050,4499,4500],{},"    client_body_timeout 12;\n",[1050,4502,4503],{"class":1052,"line":1659},[1050,4504,4505],{},"    client_header_timeout 12;\n",[1050,4507,4508],{"class":1052,"line":2103},[1050,4509,4510],{},"    send_timeout 10;\n",[1050,4512,4513],{"class":1052,"line":2109},[1050,4514,4282],{},[1050,4516,4517],{"class":1052,"line":2115},[1050,4518,4519],{},"    # Include site configurations\n",[1050,4521,4522],{"class":1052,"line":2121},[1050,4523,4524],{},"    include /etc/nginx/conf.d/*.conf;\n",[1050,4526,4527],{"class":1052,"line":2127},[1050,4528,4529],{},"    include /etc/nginx/sites-enabled/*;\n",[1050,4531,4532],{"class":1052,"line":2133},[1050,4533,4233],{},[1035,4535,4537],{"id":4536},"site-specific-configuration","Site-Specific Configuration",[1040,4539,4541],{"className":4175,"code":4540,"language":4177,"meta":1045,"style":1045},"# /etc/nginx/sites-available/django_app\nupstream django_app {\n    server unix:/run/gunicorn/django_app.sock fail_timeout=0;\n}\n\n# Redirect HTTP to HTTPS\nserver {\n    listen 80;\n    server_name yourdomain.com www.yourdomain.com;\n    return 301 https://$server_name$request_uri;\n}\n\n# HTTPS Server\nserver {\n    listen 443 ssl http2;\n    server_name yourdomain.com www.yourdomain.com;\n    \n    # SSL Configuration\n    ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;\n    ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;\n    ssl_session_timeout 1d;\n    ssl_session_cache shared:SSL:50m;\n    ssl_session_tickets off;\n    \n    # Modern SSL configuration\n    ssl_protocols TLSv1.2 TLSv1.3;\n    ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384;\n    ssl_prefer_server_ciphers off;\n    \n    # HSTS\n    add_header Strict-Transport-Security \"max-age=63072000\" always;\n    \n    # Security Headers\n    add_header X-Frame-Options DENY always;\n    add_header X-Content-Type-Options nosniff always;\n    add_header X-XSS-Protection \"1; mode=block\" always;\n    add_header Referrer-Policy \"strict-origin-when-cross-origin\" always;\n    add_header Content-Security-Policy \"default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self'; connect-src 'self'; frame-ancestors 'none';\" always;\n    \n    # Root and index\n    root /opt/django_app/src;\n    \n    # Rate limiting\n    limit_req zone=general burst=20 nodelay;\n    limit_conn conn_limit_per_ip 10;\n    \n    # Static files\n    location /static/ {\n        alias /opt/django_app/staticfiles/;\n        expires 1y;\n        add_header Cache-Control \"public, immutable\";\n        \n        # Compression\n        gzip_static on;\n        \n        # Security\n        location ~* \\.(py|pyc|pyo|pyd|pdb|sql|sqlite|db)$ {\n            deny all;\n        }\n    }\n    \n    # Media files\n    location /media/ {\n        alias /opt/django_app/media/;\n        expires 30d;\n        add_header Cache-Control \"public\";\n        \n        # Security\n        location ~* \\.(py|pyc|pyo|pyd|pdb|sql|sqlite|db|php|pl|sh)$ {\n            deny all;\n        }\n    }\n    \n    # Admin rate limiting\n    location /admin/login/ {\n        limit_req zone=login burst=5 nodelay;\n        proxy_pass http://django_app;\n        include /etc/nginx/proxy_params;\n    }\n    \n    # API rate limiting\n    location /api/ {\n        limit_req zone=api burst=50 nodelay;\n        proxy_pass http://django_app;\n        include /etc/nginx/proxy_params;\n    }\n    \n    # Health check (no rate limiting)\n    location /health/ {\n        proxy_pass http://django_app;\n        include /etc/nginx/proxy_params;\n        access_log off;\n    }\n    \n    # Main application\n    location / {\n        proxy_pass http://django_app;\n        include /etc/nginx/proxy_params;\n    }\n    \n    # Error pages\n    error_page 404 /404.html;\n    error_page 500 502 503 504 /50x.html;\n    \n    location = /404.html {\n        root /opt/django_app/templates/errors;\n        internal;\n    }\n    \n    location = /50x.html {\n        root /opt/django_app/templates/errors;\n        internal;\n    }\n}\n",[1047,4542,4543,4548,4553,4558,4562,4566,4571,4576,4581,4586,4591,4595,4599,4604,4608,4613,4617,4621,4626,4631,4636,4641,4646,4651,4655,4660,4665,4670,4675,4679,4684,4689,4693,4698,4703,4708,4713,4718,4723,4727,4732,4737,4741,4746,4751,4756,4760,4765,4770,4775,4780,4785,4790,4795,4800,4804,4809,4814,4819,4824,4829,4833,4838,4843,4848,4853,4858,4862,4866,4871,4875,4879,4883,4887,4892,4897,4902,4907,4912,4916,4920,4925,4930,4935,4939,4943,4947,4951,4956,4961,4965,4969,4974,4978,4982,4987,4992,4996,5000,5004,5008,5013,5018,5023,5027,5032,5037,5042,5046,5050,5055,5059,5063,5067],{"__ignoreMap":1045},[1050,4544,4545],{"class":1052,"line":1053},[1050,4546,4547],{},"# /etc/nginx/sites-available/django_app\n",[1050,4549,4550],{"class":1052,"line":1060},[1050,4551,4552],{},"upstream django_app {\n",[1050,4554,4555],{"class":1052,"line":1066},[1050,4556,4557],{},"    server unix:/run/gunicorn/django_app.sock fail_timeout=0;\n",[1050,4559,4560],{"class":1052,"line":1073},[1050,4561,4233],{},[1050,4563,4564],{"class":1052,"line":1084},[1050,4565,1070],{"emptyLinePlaceholder":1069},[1050,4567,4568],{"class":1052,"line":1089},[1050,4569,4570],{},"# Redirect HTTP to HTTPS\n",[1050,4572,4573],{"class":1052,"line":1095},[1050,4574,4575],{},"server {\n",[1050,4577,4578],{"class":1052,"line":1112},[1050,4579,4580],{},"    listen 80;\n",[1050,4582,4583],{"class":1052,"line":1135},[1050,4584,4585],{},"    server_name yourdomain.com www.yourdomain.com;\n",[1050,4587,4588],{"class":1052,"line":1140},[1050,4589,4590],{},"    return 301 https://$server_name$request_uri;\n",[1050,4592,4593],{"class":1052,"line":1146},[1050,4594,4233],{},[1050,4596,4597],{"class":1052,"line":1158},[1050,4598,1070],{"emptyLinePlaceholder":1069},[1050,4600,4601],{"class":1052,"line":1173},[1050,4602,4603],{},"# HTTPS Server\n",[1050,4605,4606],{"class":1052,"line":1181},[1050,4607,4575],{},[1050,4609,4610],{"class":1052,"line":1189},[1050,4611,4612],{},"    listen 443 ssl http2;\n",[1050,4614,4615],{"class":1052,"line":1197},[1050,4616,4585],{},[1050,4618,4619],{"class":1052,"line":1205},[1050,4620,4282],{},[1050,4622,4623],{"class":1052,"line":1213},[1050,4624,4625],{},"    # SSL Configuration\n",[1050,4627,4628],{"class":1052,"line":1221},[1050,4629,4630],{},"    ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;\n",[1050,4632,4633],{"class":1052,"line":1229},[1050,4634,4635],{},"    ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;\n",[1050,4637,4638],{"class":1052,"line":1237},[1050,4639,4640],{},"    ssl_session_timeout 1d;\n",[1050,4642,4643],{"class":1052,"line":1245},[1050,4644,4645],{},"    ssl_session_cache shared:SSL:50m;\n",[1050,4647,4648],{"class":1052,"line":1253},[1050,4649,4650],{},"    ssl_session_tickets off;\n",[1050,4652,4653],{"class":1052,"line":1261},[1050,4654,4282],{},[1050,4656,4657],{"class":1052,"line":1269},[1050,4658,4659],{},"    # Modern SSL configuration\n",[1050,4661,4662],{"class":1052,"line":1277},[1050,4663,4664],{},"    ssl_protocols TLSv1.2 TLSv1.3;\n",[1050,4666,4667],{"class":1052,"line":1285},[1050,4668,4669],{},"    ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384;\n",[1050,4671,4672],{"class":1052,"line":1291},[1050,4673,4674],{},"    ssl_prefer_server_ciphers off;\n",[1050,4676,4677],{"class":1052,"line":1296},[1050,4678,4282],{},[1050,4680,4681],{"class":1052,"line":1302},[1050,4682,4683],{},"    # HSTS\n",[1050,4685,4686],{"class":1052,"line":1314},[1050,4687,4688],{},"    add_header Strict-Transport-Security \"max-age=63072000\" always;\n",[1050,4690,4691],{"class":1052,"line":1325},[1050,4692,4282],{},[1050,4694,4695],{"class":1052,"line":1333},[1050,4696,4697],{},"    # Security Headers\n",[1050,4699,4700],{"class":1052,"line":1341},[1050,4701,4702],{},"    add_header X-Frame-Options DENY always;\n",[1050,4704,4705],{"class":1052,"line":1349},[1050,4706,4707],{},"    add_header X-Content-Type-Options nosniff always;\n",[1050,4709,4710],{"class":1052,"line":1357},[1050,4711,4712],{},"    add_header X-XSS-Protection \"1; mode=block\" always;\n",[1050,4714,4715],{"class":1052,"line":1365},[1050,4716,4717],{},"    add_header Referrer-Policy \"strict-origin-when-cross-origin\" always;\n",[1050,4719,4720],{"class":1052,"line":1373},[1050,4721,4722],{},"    add_header Content-Security-Policy \"default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self'; connect-src 'self'; frame-ancestors 'none';\" always;\n",[1050,4724,4725],{"class":1052,"line":1381},[1050,4726,4282],{},[1050,4728,4729],{"class":1052,"line":1389},[1050,4730,4731],{},"    # Root and index\n",[1050,4733,4734],{"class":1052,"line":1397},[1050,4735,4736],{},"    root /opt/django_app/src;\n",[1050,4738,4739],{"class":1052,"line":1405},[1050,4740,4282],{},[1050,4742,4743],{"class":1052,"line":1413},[1050,4744,4745],{},"    # Rate limiting\n",[1050,4747,4748],{"class":1052,"line":1421},[1050,4749,4750],{},"    limit_req zone=general burst=20 nodelay;\n",[1050,4752,4753],{"class":1052,"line":1427},[1050,4754,4755],{},"    limit_conn conn_limit_per_ip 10;\n",[1050,4757,4758],{"class":1052,"line":1432},[1050,4759,4282],{},[1050,4761,4762],{"class":1052,"line":1438},[1050,4763,4764],{},"    # Static files\n",[1050,4766,4767],{"class":1052,"line":1450},[1050,4768,4769],{},"    location /static/ {\n",[1050,4771,4772],{"class":1052,"line":1468},[1050,4773,4774],{},"        alias /opt/django_app/staticfiles/;\n",[1050,4776,4777],{"class":1052,"line":1473},[1050,4778,4779],{},"        expires 1y;\n",[1050,4781,4782],{"class":1052,"line":1479},[1050,4783,4784],{},"        add_header Cache-Control \"public, immutable\";\n",[1050,4786,4787],{"class":1052,"line":1491},[1050,4788,4789],{},"        \n",[1050,4791,4792],{"class":1052,"line":1503},[1050,4793,4794],{},"        # Compression\n",[1050,4796,4797],{"class":1052,"line":1508},[1050,4798,4799],{},"        gzip_static on;\n",[1050,4801,4802],{"class":1052,"line":1514},[1050,4803,4789],{},[1050,4805,4806],{"class":1052,"line":1526},[1050,4807,4808],{},"        # Security\n",[1050,4810,4811],{"class":1052,"line":1553},[1050,4812,4813],{},"        location ~* \\.(py|pyc|pyo|pyd|pdb|sql|sqlite|db)$ {\n",[1050,4815,4816],{"class":1052,"line":1570},[1050,4817,4818],{},"            deny all;\n",[1050,4820,4821],{"class":1052,"line":1575},[1050,4822,4823],{},"        }\n",[1050,4825,4826],{"class":1052,"line":1581},[1050,4827,4828],{},"    }\n",[1050,4830,4831],{"class":1052,"line":1593},[1050,4832,4282],{},[1050,4834,4835],{"class":1052,"line":1605},[1050,4836,4837],{},"    # Media files\n",[1050,4839,4840],{"class":1052,"line":1615},[1050,4841,4842],{},"    location /media/ {\n",[1050,4844,4845],{"class":1052,"line":1630},[1050,4846,4847],{},"        alias /opt/django_app/media/;\n",[1050,4849,4850],{"class":1052,"line":1642},[1050,4851,4852],{},"        expires 30d;\n",[1050,4854,4855],{"class":1052,"line":1654},[1050,4856,4857],{},"        add_header Cache-Control \"public\";\n",[1050,4859,4860],{"class":1052,"line":1659},[1050,4861,4789],{},[1050,4863,4864],{"class":1052,"line":2103},[1050,4865,4808],{},[1050,4867,4868],{"class":1052,"line":2109},[1050,4869,4870],{},"        location ~* \\.(py|pyc|pyo|pyd|pdb|sql|sqlite|db|php|pl|sh)$ {\n",[1050,4872,4873],{"class":1052,"line":2115},[1050,4874,4818],{},[1050,4876,4877],{"class":1052,"line":2121},[1050,4878,4823],{},[1050,4880,4881],{"class":1052,"line":2127},[1050,4882,4828],{},[1050,4884,4885],{"class":1052,"line":2133},[1050,4886,4282],{},[1050,4888,4889],{"class":1052,"line":2138},[1050,4890,4891],{},"    # Admin rate limiting\n",[1050,4893,4894],{"class":1052,"line":2144},[1050,4895,4896],{},"    location /admin/login/ {\n",[1050,4898,4899],{"class":1052,"line":2150},[1050,4900,4901],{},"        limit_req zone=login burst=5 nodelay;\n",[1050,4903,4904],{"class":1052,"line":2156},[1050,4905,4906],{},"        proxy_pass http://django_app;\n",[1050,4908,4909],{"class":1052,"line":2161},[1050,4910,4911],{},"        include /etc/nginx/proxy_params;\n",[1050,4913,4914],{"class":1052,"line":2167},[1050,4915,4828],{},[1050,4917,4918],{"class":1052,"line":2173},[1050,4919,4282],{},[1050,4921,4922],{"class":1052,"line":2178},[1050,4923,4924],{},"    # API rate limiting\n",[1050,4926,4927],{"class":1052,"line":2184},[1050,4928,4929],{},"    location /api/ {\n",[1050,4931,4932],{"class":1052,"line":2190},[1050,4933,4934],{},"        limit_req zone=api burst=50 nodelay;\n",[1050,4936,4937],{"class":1052,"line":2196},[1050,4938,4906],{},[1050,4940,4941],{"class":1052,"line":2201},[1050,4942,4911],{},[1050,4944,4945],{"class":1052,"line":2207},[1050,4946,4828],{},[1050,4948,4949],{"class":1052,"line":2213},[1050,4950,4282],{},[1050,4952,4953],{"class":1052,"line":2218},[1050,4954,4955],{},"    # Health check (no rate limiting)\n",[1050,4957,4958],{"class":1052,"line":2224},[1050,4959,4960],{},"    location /health/ {\n",[1050,4962,4963],{"class":1052,"line":2230},[1050,4964,4906],{},[1050,4966,4967],{"class":1052,"line":2236},[1050,4968,4911],{},[1050,4970,4971],{"class":1052,"line":2241},[1050,4972,4973],{},"        access_log off;\n",[1050,4975,4976],{"class":1052,"line":2247},[1050,4977,4828],{},[1050,4979,4980],{"class":1052,"line":2253},[1050,4981,4282],{},[1050,4983,4984],{"class":1052,"line":2259},[1050,4985,4986],{},"    # Main application\n",[1050,4988,4989],{"class":1052,"line":2264},[1050,4990,4991],{},"    location / {\n",[1050,4993,4994],{"class":1052,"line":2270},[1050,4995,4906],{},[1050,4997,4998],{"class":1052,"line":2276},[1050,4999,4911],{},[1050,5001,5002],{"class":1052,"line":2282},[1050,5003,4828],{},[1050,5005,5006],{"class":1052,"line":2288},[1050,5007,4282],{},[1050,5009,5010],{"class":1052,"line":2294},[1050,5011,5012],{},"    # Error pages\n",[1050,5014,5015],{"class":1052,"line":2299},[1050,5016,5017],{},"    error_page 404 /404.html;\n",[1050,5019,5020],{"class":1052,"line":2305},[1050,5021,5022],{},"    error_page 500 502 503 504 /50x.html;\n",[1050,5024,5025],{"class":1052,"line":2311},[1050,5026,4282],{},[1050,5028,5029],{"class":1052,"line":2317},[1050,5030,5031],{},"    location = /404.html {\n",[1050,5033,5034],{"class":1052,"line":2322},[1050,5035,5036],{},"        root /opt/django_app/templates/errors;\n",[1050,5038,5039],{"class":1052,"line":2328},[1050,5040,5041],{},"        internal;\n",[1050,5043,5044],{"class":1052,"line":2334},[1050,5045,4828],{},[1050,5047,5048],{"class":1052,"line":2340},[1050,5049,4282],{},[1050,5051,5052],{"class":1052,"line":2346},[1050,5053,5054],{},"    location = /50x.html {\n",[1050,5056,5057],{"class":1052,"line":2351},[1050,5058,5036],{},[1050,5060,5061],{"class":1052,"line":2356},[1050,5062,5041],{},[1050,5064,5065],{"class":1052,"line":2366},[1050,5066,4828],{},[1050,5068,5069],{"class":1052,"line":2371},[1050,5070,4233],{},[1035,5072,5074],{"id":5073},"proxy-parameters","Proxy Parameters",[1040,5076,5078],{"className":4175,"code":5077,"language":4177,"meta":1045,"style":1045},"# /etc/nginx/proxy_params\nproxy_set_header Host $http_host;\nproxy_set_header X-Real-IP $remote_addr;\nproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\nproxy_set_header X-Forwarded-Proto $scheme;\nproxy_set_header X-Forwarded-Host $server_name;\nproxy_set_header X-Forwarded-Port $server_port;\n\nproxy_connect_timeout 60s;\nproxy_send_timeout 60s;\nproxy_read_timeout 60s;\n\nproxy_buffering on;\nproxy_buffer_size 4k;\nproxy_buffers 8 4k;\nproxy_busy_buffers_size 8k;\n\nproxy_redirect off;\n",[1047,5079,5080,5085,5090,5095,5100,5105,5110,5115,5119,5124,5129,5134,5138,5143,5148,5153,5158,5162],{"__ignoreMap":1045},[1050,5081,5082],{"class":1052,"line":1053},[1050,5083,5084],{},"# /etc/nginx/proxy_params\n",[1050,5086,5087],{"class":1052,"line":1060},[1050,5088,5089],{},"proxy_set_header Host $http_host;\n",[1050,5091,5092],{"class":1052,"line":1066},[1050,5093,5094],{},"proxy_set_header X-Real-IP $remote_addr;\n",[1050,5096,5097],{"class":1052,"line":1073},[1050,5098,5099],{},"proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n",[1050,5101,5102],{"class":1052,"line":1084},[1050,5103,5104],{},"proxy_set_header X-Forwarded-Proto $scheme;\n",[1050,5106,5107],{"class":1052,"line":1089},[1050,5108,5109],{},"proxy_set_header X-Forwarded-Host $server_name;\n",[1050,5111,5112],{"class":1052,"line":1095},[1050,5113,5114],{},"proxy_set_header X-Forwarded-Port $server_port;\n",[1050,5116,5117],{"class":1052,"line":1112},[1050,5118,1070],{"emptyLinePlaceholder":1069},[1050,5120,5121],{"class":1052,"line":1135},[1050,5122,5123],{},"proxy_connect_timeout 60s;\n",[1050,5125,5126],{"class":1052,"line":1140},[1050,5127,5128],{},"proxy_send_timeout 60s;\n",[1050,5130,5131],{"class":1052,"line":1146},[1050,5132,5133],{},"proxy_read_timeout 60s;\n",[1050,5135,5136],{"class":1052,"line":1158},[1050,5137,1070],{"emptyLinePlaceholder":1069},[1050,5139,5140],{"class":1052,"line":1173},[1050,5141,5142],{},"proxy_buffering on;\n",[1050,5144,5145],{"class":1052,"line":1181},[1050,5146,5147],{},"proxy_buffer_size 4k;\n",[1050,5149,5150],{"class":1052,"line":1189},[1050,5151,5152],{},"proxy_buffers 8 4k;\n",[1050,5154,5155],{"class":1052,"line":1197},[1050,5156,5157],{},"proxy_busy_buffers_size 8k;\n",[1050,5159,5160],{"class":1052,"line":1205},[1050,5161,1070],{"emptyLinePlaceholder":1069},[1050,5163,5164],{"class":1052,"line":1213},[1050,5165,5166],{},"proxy_redirect off;\n",[1030,5168,5170],{"id":5169},"ssl-certificate-setup","SSL Certificate Setup",[1035,5172,5174],{"id":5173},"lets-encrypt-with-certbot","Let's Encrypt with Certbot",[1040,5176,5178],{"className":1042,"code":5177,"language":1044,"meta":1045,"style":1045},"#!/bin/bash\n# scripts/setup_ssl.sh - SSL certificate setup\n\nset -e\n\necho \"🔒 Setting up SSL certificates...\"\n\n# Install Certbot\napt install -y certbot python3-certbot-nginx\n\n# Obtain SSL certificate\ncertbot --nginx -d yourdomain.com -d www.yourdomain.com \\\n    --non-interactive \\\n    --agree-tos \\\n    --email admin@yourdomain.com \\\n    --redirect\n\n# Set up automatic renewal\ncat > /etc/cron.d/certbot \u003C\u003C 'EOF'\n0 12 * * * root test -x /usr/bin/certbot -a \\! -d /run/systemd/system && perl -e 'sleep int(rand(43200))' && certbot -q renew --nginx\nEOF\n\n# Test renewal\ncertbot renew --dry-run\n\necho \"✅ SSL certificates configured!\"\n",[1047,5179,5180,5184,5189,5193,5199,5203,5214,5218,5223,5237,5241,5246,5267,5274,5281,5291,5296,5300,5305,5318,5323,5327,5331,5336,5346,5350],{"__ignoreMap":1045},[1050,5181,5182],{"class":1052,"line":1053},[1050,5183,1057],{"class":1056},[1050,5185,5186],{"class":1052,"line":1060},[1050,5187,5188],{"class":1056},"# scripts/setup_ssl.sh - SSL certificate setup\n",[1050,5190,5191],{"class":1052,"line":1066},[1050,5192,1070],{"emptyLinePlaceholder":1069},[1050,5194,5195,5197],{"class":1052,"line":1073},[1050,5196,1077],{"class":1076},[1050,5198,1081],{"class":1080},[1050,5200,5201],{"class":1052,"line":1084},[1050,5202,1070],{"emptyLinePlaceholder":1069},[1050,5204,5205,5207,5209,5212],{"class":1052,"line":1089},[1050,5206,1098],{"class":1076},[1050,5208,1102],{"class":1101},[1050,5210,5211],{"class":1105},"🔒 Setting up SSL certificates...",[1050,5213,1109],{"class":1101},[1050,5215,5216],{"class":1052,"line":1095},[1050,5217,1070],{"emptyLinePlaceholder":1069},[1050,5219,5220],{"class":1052,"line":1112},[1050,5221,5222],{"class":1056},"# Install Certbot\n",[1050,5224,5225,5227,5229,5231,5234],{"class":1052,"line":1135},[1050,5226,1116],{"class":1115},[1050,5228,1163],{"class":1105},[1050,5230,1166],{"class":1080},[1050,5232,5233],{"class":1105}," certbot",[1050,5235,5236],{"class":1105}," python3-certbot-nginx\n",[1050,5238,5239],{"class":1052,"line":1140},[1050,5240,1070],{"emptyLinePlaceholder":1069},[1050,5242,5243],{"class":1052,"line":1146},[1050,5244,5245],{"class":1056},"# Obtain SSL certificate\n",[1050,5247,5248,5251,5254,5257,5260,5262,5265],{"class":1052,"line":1158},[1050,5249,5250],{"class":1115},"certbot",[1050,5252,5253],{"class":1080}," --nginx",[1050,5255,5256],{"class":1080}," -d",[1050,5258,5259],{"class":1105}," yourdomain.com",[1050,5261,5256],{"class":1080},[1050,5263,5264],{"class":1105}," www.yourdomain.com",[1050,5266,1170],{"class":1169},[1050,5268,5269,5272],{"class":1052,"line":1173},[1050,5270,5271],{"class":1080},"    --non-interactive",[1050,5273,1170],{"class":1169},[1050,5275,5276,5279],{"class":1052,"line":1181},[1050,5277,5278],{"class":1080},"    --agree-tos",[1050,5280,1170],{"class":1169},[1050,5282,5283,5286,5289],{"class":1052,"line":1189},[1050,5284,5285],{"class":1080},"    --email",[1050,5287,5288],{"class":1105}," admin@yourdomain.com",[1050,5290,1170],{"class":1169},[1050,5292,5293],{"class":1052,"line":1197},[1050,5294,5295],{"class":1080},"    --redirect\n",[1050,5297,5298],{"class":1052,"line":1205},[1050,5299,1070],{"emptyLinePlaceholder":1069},[1050,5301,5302],{"class":1052,"line":1213},[1050,5303,5304],{"class":1056},"# Set up automatic renewal\n",[1050,5306,5307,5309,5311,5314,5316],{"class":1052,"line":1221},[1050,5308,1828],{"class":1115},[1050,5310,1832],{"class":1831},[1050,5312,5313],{"class":1105}," /etc/cron.d/certbot",[1050,5315,1838],{"class":1831},[1050,5317,1841],{"class":1101},[1050,5319,5320],{"class":1052,"line":1229},[1050,5321,5322],{"class":1105},"0 12 * * * root test -x /usr/bin/certbot -a \\! -d /run/systemd/system && perl -e 'sleep int(rand(43200))' && certbot -q renew --nginx\n",[1050,5324,5325],{"class":1052,"line":1237},[1050,5326,1983],{"class":1101},[1050,5328,5329],{"class":1052,"line":1245},[1050,5330,1070],{"emptyLinePlaceholder":1069},[1050,5332,5333],{"class":1052,"line":1253},[1050,5334,5335],{"class":1056},"# Test renewal\n",[1050,5337,5338,5340,5343],{"class":1052,"line":1261},[1050,5339,5250],{"class":1115},[1050,5341,5342],{"class":1105}," renew",[1050,5344,5345],{"class":1080}," --dry-run\n",[1050,5347,5348],{"class":1052,"line":1269},[1050,5349,1070],{"emptyLinePlaceholder":1069},[1050,5351,5352,5354,5356,5359],{"class":1052,"line":1277},[1050,5353,1098],{"class":1076},[1050,5355,1102],{"class":1101},[1050,5357,5358],{"class":1105},"✅ SSL certificates configured!",[1050,5360,1109],{"class":1101},[1030,5362,767],{"id":5363},"monitoring-and-logging",[1035,5365,5367],{"id":5366},"log-rotation-configuration","Log Rotation Configuration",[1040,5369,5371],{"className":1042,"code":5370,"language":1044,"meta":1045,"style":1045},"# /etc/logrotate.d/django_app\n/var/log/django/*.log {\n    daily\n    missingok\n    rotate 52\n    compress\n    delaycompress\n    notifempty\n    create 644 django django\n    postrotate\n        systemctl reload django_app\n    endscript\n}\n\n/var/log/gunicorn/*.log {\n    daily\n    missingok\n    rotate 52\n    compress\n    delaycompress\n    notifempty\n    create 644 django django\n    postrotate\n        systemctl reload django_app\n    endscript\n}\n\n/var/log/nginx/*.log {\n    daily\n    missingok\n    rotate 52\n    compress\n    delaycompress\n    notifempty\n    create 644 www-data adm\n    prerotate\n        if [ -d /etc/logrotate.d/httpd-prerotate ]; then \\\n            run-parts /etc/logrotate.d/httpd-prerotate; \\\n        fi\n    endscript\n    postrotate\n        systemctl reload nginx\n    endscript\n}\n",[1047,5372,5373,5378,5386,5391,5396,5404,5409,5414,5419,5432,5437,5448,5453,5458,5462,5469,5473,5477,5483,5487,5491,5495,5505,5509,5517,5521,5525,5529,5536,5540,5544,5550,5554,5558,5562,5573,5578,5599,5611,5616,5620,5624,5632,5636],{"__ignoreMap":1045},[1050,5374,5375],{"class":1052,"line":1053},[1050,5376,5377],{"class":1056},"# /etc/logrotate.d/django_app\n",[1050,5379,5380,5383],{"class":1052,"line":1060},[1050,5381,5382],{"class":1115},"/var/log/django/*.log",[1050,5384,5385],{"class":1105}," {\n",[1050,5387,5388],{"class":1052,"line":1066},[1050,5389,5390],{"class":1115},"    daily\n",[1050,5392,5393],{"class":1052,"line":1073},[1050,5394,5395],{"class":1115},"    missingok\n",[1050,5397,5398,5401],{"class":1052,"line":1084},[1050,5399,5400],{"class":1115},"    rotate",[1050,5402,5403],{"class":3225}," 52\n",[1050,5405,5406],{"class":1052,"line":1089},[1050,5407,5408],{"class":1115},"    compress\n",[1050,5410,5411],{"class":1052,"line":1095},[1050,5412,5413],{"class":1115},"    delaycompress\n",[1050,5415,5416],{"class":1052,"line":1112},[1050,5417,5418],{"class":1115},"    notifempty\n",[1050,5420,5421,5424,5427,5430],{"class":1052,"line":1135},[1050,5422,5423],{"class":1115},"    create",[1050,5425,5426],{"class":3225}," 644",[1050,5428,5429],{"class":1105}," django",[1050,5431,1550],{"class":1105},[1050,5433,5434],{"class":1052,"line":1140},[1050,5435,5436],{"class":1115},"    postrotate\n",[1050,5438,5439,5442,5445],{"class":1052,"line":1146},[1050,5440,5441],{"class":1115},"        systemctl",[1050,5443,5444],{"class":1105}," reload",[1050,5446,5447],{"class":1105}," django_app\n",[1050,5449,5450],{"class":1052,"line":1158},[1050,5451,5452],{"class":1115},"    endscript\n",[1050,5454,5455],{"class":1052,"line":1173},[1050,5456,4233],{"class":5457},"sftqT",[1050,5459,5460],{"class":1052,"line":1181},[1050,5461,1070],{"emptyLinePlaceholder":1069},[1050,5463,5464,5467],{"class":1052,"line":1189},[1050,5465,5466],{"class":1115},"/var/log/gunicorn/*.log",[1050,5468,5385],{"class":1105},[1050,5470,5471],{"class":1052,"line":1197},[1050,5472,5390],{"class":1115},[1050,5474,5475],{"class":1052,"line":1205},[1050,5476,5395],{"class":1115},[1050,5478,5479,5481],{"class":1052,"line":1213},[1050,5480,5400],{"class":1115},[1050,5482,5403],{"class":3225},[1050,5484,5485],{"class":1052,"line":1221},[1050,5486,5408],{"class":1115},[1050,5488,5489],{"class":1052,"line":1229},[1050,5490,5413],{"class":1115},[1050,5492,5493],{"class":1052,"line":1237},[1050,5494,5418],{"class":1115},[1050,5496,5497,5499,5501,5503],{"class":1052,"line":1245},[1050,5498,5423],{"class":1115},[1050,5500,5426],{"class":3225},[1050,5502,5429],{"class":1105},[1050,5504,1550],{"class":1105},[1050,5506,5507],{"class":1052,"line":1253},[1050,5508,5436],{"class":1115},[1050,5510,5511,5513,5515],{"class":1052,"line":1261},[1050,5512,5441],{"class":1115},[1050,5514,5444],{"class":1105},[1050,5516,5447],{"class":1105},[1050,5518,5519],{"class":1052,"line":1269},[1050,5520,5452],{"class":1115},[1050,5522,5523],{"class":1052,"line":1277},[1050,5524,4233],{"class":5457},[1050,5526,5527],{"class":1052,"line":1285},[1050,5528,1070],{"emptyLinePlaceholder":1069},[1050,5530,5531,5534],{"class":1052,"line":1291},[1050,5532,5533],{"class":1115},"/var/log/nginx/*.log",[1050,5535,5385],{"class":1105},[1050,5537,5538],{"class":1052,"line":1296},[1050,5539,5390],{"class":1115},[1050,5541,5542],{"class":1052,"line":1302},[1050,5543,5395],{"class":1115},[1050,5545,5546,5548],{"class":1052,"line":1314},[1050,5547,5400],{"class":1115},[1050,5549,5403],{"class":3225},[1050,5551,5552],{"class":1052,"line":1325},[1050,5553,5408],{"class":1115},[1050,5555,5556],{"class":1052,"line":1333},[1050,5557,5413],{"class":1115},[1050,5559,5560],{"class":1052,"line":1341},[1050,5561,5418],{"class":1115},[1050,5563,5564,5566,5568,5570],{"class":1052,"line":1349},[1050,5565,5423],{"class":1115},[1050,5567,5426],{"class":3225},[1050,5569,1565],{"class":1105},[1050,5571,5572],{"class":1105}," adm\n",[1050,5574,5575],{"class":1052,"line":1357},[1050,5576,5577],{"class":1115},"    prerotate\n",[1050,5579,5580,5583,5586,5588,5591,5594,5597],{"class":1052,"line":1365},[1050,5581,5582],{"class":3830},"        if",[1050,5584,5585],{"class":1122}," [",[1050,5587,5256],{"class":1831},[1050,5589,5590],{"class":5457}," /etc/logrotate.d/httpd-prerotate ",[1050,5592,5593],{"class":1122},"];",[1050,5595,5596],{"class":3830}," then",[1050,5598,1170],{"class":1169},[1050,5600,5601,5604,5607,5609],{"class":1052,"line":1373},[1050,5602,5603],{"class":1115},"            run-parts",[1050,5605,5606],{"class":1105}," /etc/logrotate.d/httpd-prerotate",[1050,5608,3851],{"class":1122},[1050,5610,1170],{"class":1169},[1050,5612,5613],{"class":1052,"line":1381},[1050,5614,5615],{"class":3830},"        fi\n",[1050,5617,5618],{"class":1052,"line":1389},[1050,5619,5452],{"class":1115},[1050,5621,5622],{"class":1052,"line":1397},[1050,5623,5436],{"class":1115},[1050,5625,5626,5628,5630],{"class":1052,"line":1405},[1050,5627,5441],{"class":1115},[1050,5629,5444],{"class":1105},[1050,5631,1500],{"class":1105},[1050,5633,5634],{"class":1052,"line":1413},[1050,5635,5452],{"class":1115},[1050,5637,5638],{"class":1052,"line":1421},[1050,5639,4233],{"class":5457},[1035,5641,5643],{"id":5642},"system-monitoring-script","System Monitoring Script",[1040,5645,5647],{"className":1042,"code":5646,"language":1044,"meta":1045,"style":1045},"#!/bin/bash\n# scripts/monitor_system.sh - System monitoring script\n\n# Configuration\nALERT_EMAIL=\"admin@yourdomain.com\"\nCPU_THRESHOLD=80\nMEMORY_THRESHOLD=80\nDISK_THRESHOLD=85\n\n# Check CPU usage\nCPU_USAGE=$(top -bn1 | grep \"Cpu(s)\" | awk '{print $2}' | awk -F'%' '{print $1}')\nif (( $(echo \"$CPU_USAGE > $CPU_THRESHOLD\" | bc -l) )); then\n    echo \"High CPU usage: $CPU_USAGE%\" | mail -s \"Server Alert: High CPU\" $ALERT_EMAIL\nfi\n\n# Check memory usage\nMEMORY_USAGE=$(free | grep Mem | awk '{printf(\"%.1f\", $3/$2 * 100.0)}')\nif (( $(echo \"$MEMORY_USAGE > $MEMORY_THRESHOLD\" | bc -l) )); then\n    echo \"High memory usage: $MEMORY_USAGE%\" | mail -s \"Server Alert: High Memory\" $ALERT_EMAIL\nfi\n\n# Check disk usage\nDISK_USAGE=$(df -h / | awk 'NR==2 {print $5}' | sed 's/%//')\nif [ $DISK_USAGE -gt $DISK_THRESHOLD ]; then\n    echo \"High disk usage: $DISK_USAGE%\" | mail -s \"Server Alert: High Disk Usage\" $ALERT_EMAIL\nfi\n\n# Check if Django app is running\nif ! systemctl is-active --quiet django_app; then\n    echo \"Django application is not running!\" | mail -s \"Server Alert: Django App Down\" $ALERT_EMAIL\nfi\n\n# Check if Nginx is running\nif ! systemctl is-active --quiet nginx; then\n    echo \"Nginx is not running!\" | mail -s \"Server Alert: Nginx Down\" $ALERT_EMAIL\nfi\n\n# Check database connectivity\nif ! sudo -u django psql -d django_app -c \"SELECT 1;\" > /dev/null 2>&1; then\n    echo \"Database connection failed!\" | mail -s \"Server Alert: Database Connection Failed\" $ALERT_EMAIL\nfi\n",[1047,5648,5649,5653,5658,5662,5666,5680,5690,5699,5709,5713,5718,5783,5829,5861,5865,5869,5874,5904,5942,5972,5976,5980,5985,6026,6046,6077,6081,6085,6090,6113,6139,6143,6147,6152,6171,6197,6201,6205,6210,6250,6276],{"__ignoreMap":1045},[1050,5650,5651],{"class":1052,"line":1053},[1050,5652,1057],{"class":1056},[1050,5654,5655],{"class":1052,"line":1060},[1050,5656,5657],{"class":1056},"# scripts/monitor_system.sh - System monitoring script\n",[1050,5659,5660],{"class":1052,"line":1066},[1050,5661,1070],{"emptyLinePlaceholder":1069},[1050,5663,5664],{"class":1052,"line":1073},[1050,5665,3309],{"class":1056},[1050,5667,5668,5671,5673,5675,5678],{"class":1052,"line":1084},[1050,5669,5670],{"class":3314},"ALERT_EMAIL",[1050,5672,3318],{"class":1122},[1050,5674,3321],{"class":1101},[1050,5676,5677],{"class":1105},"admin@yourdomain.com",[1050,5679,1109],{"class":1101},[1050,5681,5682,5685,5687],{"class":1052,"line":1089},[1050,5683,5684],{"class":3314},"CPU_THRESHOLD",[1050,5686,3318],{"class":1122},[1050,5688,5689],{"class":1105},"80\n",[1050,5691,5692,5695,5697],{"class":1052,"line":1095},[1050,5693,5694],{"class":3314},"MEMORY_THRESHOLD",[1050,5696,3318],{"class":1122},[1050,5698,5689],{"class":1105},[1050,5700,5701,5704,5706],{"class":1052,"line":1112},[1050,5702,5703],{"class":3314},"DISK_THRESHOLD",[1050,5705,3318],{"class":1122},[1050,5707,5708],{"class":1105},"85\n",[1050,5710,5711],{"class":1052,"line":1135},[1050,5712,1070],{"emptyLinePlaceholder":1069},[1050,5714,5715],{"class":1052,"line":1140},[1050,5716,5717],{"class":1056},"# Check CPU usage\n",[1050,5719,5720,5723,5726,5729,5732,5735,5738,5740,5743,5745,5747,5750,5753,5756,5759,5761,5763,5766,5768,5771,5773,5775,5778,5780],{"class":1052,"line":1146},[1050,5721,5722],{"class":3314},"CPU_USAGE",[1050,5724,5725],{"class":1122},"=$(",[1050,5727,5728],{"class":1115},"top",[1050,5730,5731],{"class":1080}," -bn1",[1050,5733,5734],{"class":1831}," |",[1050,5736,5737],{"class":1115}," grep",[1050,5739,1102],{"class":1101},[1050,5741,5742],{"class":1105},"Cpu(s)",[1050,5744,3321],{"class":1101},[1050,5746,5734],{"class":1831},[1050,5748,5749],{"class":1115}," awk",[1050,5751,5752],{"class":1101}," '",[1050,5754,5755],{"class":1105},"{print $2}",[1050,5757,5758],{"class":1101},"'",[1050,5760,5734],{"class":1831},[1050,5762,5749],{"class":1115},[1050,5764,5765],{"class":1080}," -F",[1050,5767,5758],{"class":1101},[1050,5769,5770],{"class":1105},"%",[1050,5772,5758],{"class":1101},[1050,5774,5752],{"class":1101},[1050,5776,5777],{"class":1105},"{print $1}",[1050,5779,5758],{"class":1101},[1050,5781,5782],{"class":1122},")\n",[1050,5784,5785,5787,5790,5793,5795,5797,5800,5803,5806,5808,5810,5813,5816,5819,5822,5825,5827],{"class":1052,"line":1158},[1050,5786,3831],{"class":3830},[1050,5788,5789],{"class":1122}," ((",[1050,5791,5792],{"class":5457}," $(",[1050,5794,1098],{"class":3314},[1050,5796,1102],{"class":1101},[1050,5798,5799],{"class":3355},"$CPU_USAGE",[1050,5801,5802],{"class":1105}," > ",[1050,5804,5805],{"class":3355},"$CPU_THRESHOLD",[1050,5807,3321],{"class":1101},[1050,5809,5734],{"class":1831},[1050,5811,5812],{"class":3314}," bc",[1050,5814,5815],{"class":1831}," -",[1050,5817,5818],{"class":3314},"l",[1050,5820,5821],{"class":1122},") )",[1050,5823,5824],{"class":5457},")",[1050,5826,3851],{"class":1122},[1050,5828,3854],{"class":3830},[1050,5830,5831,5833,5835,5838,5840,5842,5844,5846,5849,5851,5853,5856,5858],{"class":1052,"line":1173},[1050,5832,3859],{"class":1076},[1050,5834,1102],{"class":1101},[1050,5836,5837],{"class":1105},"High CPU usage: ",[1050,5839,5799],{"class":3355},[1050,5841,5770],{"class":1105},[1050,5843,3321],{"class":1101},[1050,5845,5734],{"class":1831},[1050,5847,5848],{"class":1115}," mail",[1050,5850,3840],{"class":1080},[1050,5852,1102],{"class":1101},[1050,5854,5855],{"class":1105},"Server Alert: High CPU",[1050,5857,3321],{"class":1101},[1050,5859,5860],{"class":3314}," $ALERT_EMAIL\n",[1050,5862,5863],{"class":1052,"line":1181},[1050,5864,3503],{"class":3830},[1050,5866,5867],{"class":1052,"line":1189},[1050,5868,1070],{"emptyLinePlaceholder":1069},[1050,5870,5871],{"class":1052,"line":1197},[1050,5872,5873],{"class":1056},"# Check memory usage\n",[1050,5875,5876,5879,5881,5884,5886,5888,5891,5893,5895,5897,5900,5902],{"class":1052,"line":1205},[1050,5877,5878],{"class":3314},"MEMORY_USAGE",[1050,5880,5725],{"class":1122},[1050,5882,5883],{"class":1115},"free",[1050,5885,5734],{"class":1831},[1050,5887,5737],{"class":1115},[1050,5889,5890],{"class":1105}," Mem",[1050,5892,5734],{"class":1831},[1050,5894,5749],{"class":1115},[1050,5896,5752],{"class":1101},[1050,5898,5899],{"class":1105},"{printf(\"%.1f\", $3/$2 * 100.0)}",[1050,5901,5758],{"class":1101},[1050,5903,5782],{"class":1122},[1050,5905,5906,5908,5910,5912,5914,5916,5919,5921,5924,5926,5928,5930,5932,5934,5936,5938,5940],{"class":1052,"line":1213},[1050,5907,3831],{"class":3830},[1050,5909,5789],{"class":1122},[1050,5911,5792],{"class":5457},[1050,5913,1098],{"class":3314},[1050,5915,1102],{"class":1101},[1050,5917,5918],{"class":3355},"$MEMORY_USAGE",[1050,5920,5802],{"class":1105},[1050,5922,5923],{"class":3355},"$MEMORY_THRESHOLD",[1050,5925,3321],{"class":1101},[1050,5927,5734],{"class":1831},[1050,5929,5812],{"class":3314},[1050,5931,5815],{"class":1831},[1050,5933,5818],{"class":3314},[1050,5935,5821],{"class":1122},[1050,5937,5824],{"class":5457},[1050,5939,3851],{"class":1122},[1050,5941,3854],{"class":3830},[1050,5943,5944,5946,5948,5951,5953,5955,5957,5959,5961,5963,5965,5968,5970],{"class":1052,"line":1221},[1050,5945,3859],{"class":1076},[1050,5947,1102],{"class":1101},[1050,5949,5950],{"class":1105},"High memory usage: ",[1050,5952,5918],{"class":3355},[1050,5954,5770],{"class":1105},[1050,5956,3321],{"class":1101},[1050,5958,5734],{"class":1831},[1050,5960,5848],{"class":1115},[1050,5962,3840],{"class":1080},[1050,5964,1102],{"class":1101},[1050,5966,5967],{"class":1105},"Server Alert: High Memory",[1050,5969,3321],{"class":1101},[1050,5971,5860],{"class":3314},[1050,5973,5974],{"class":1052,"line":1229},[1050,5975,3503],{"class":3830},[1050,5977,5978],{"class":1052,"line":1237},[1050,5979,1070],{"emptyLinePlaceholder":1069},[1050,5981,5982],{"class":1052,"line":1245},[1050,5983,5984],{"class":1056},"# Check disk usage\n",[1050,5986,5987,5990,5992,5995,5998,6001,6003,6005,6007,6010,6012,6014,6017,6019,6022,6024],{"class":1052,"line":1253},[1050,5988,5989],{"class":3314},"DISK_USAGE",[1050,5991,5725],{"class":1122},[1050,5993,5994],{"class":1115},"df",[1050,5996,5997],{"class":1080}," -h",[1050,5999,6000],{"class":1105}," /",[1050,6002,5734],{"class":1831},[1050,6004,5749],{"class":1115},[1050,6006,5752],{"class":1101},[1050,6008,6009],{"class":1105},"NR==2 {print $5}",[1050,6011,5758],{"class":1101},[1050,6013,5734],{"class":1831},[1050,6015,6016],{"class":1115}," sed",[1050,6018,5752],{"class":1101},[1050,6020,6021],{"class":1105},"s/%//",[1050,6023,5758],{"class":1101},[1050,6025,5782],{"class":1122},[1050,6027,6028,6030,6032,6035,6038,6041,6044],{"class":1052,"line":1261},[1050,6029,3831],{"class":3830},[1050,6031,5585],{"class":1122},[1050,6033,6034],{"class":3314}," $DISK_USAGE",[1050,6036,6037],{"class":1831}," -gt",[1050,6039,6040],{"class":3314}," $DISK_THRESHOLD",[1050,6042,6043],{"class":1122}," ];",[1050,6045,3854],{"class":3830},[1050,6047,6048,6050,6052,6055,6058,6060,6062,6064,6066,6068,6070,6073,6075],{"class":1052,"line":1269},[1050,6049,3859],{"class":1076},[1050,6051,1102],{"class":1101},[1050,6053,6054],{"class":1105},"High disk usage: ",[1050,6056,6057],{"class":3355},"$DISK_USAGE",[1050,6059,5770],{"class":1105},[1050,6061,3321],{"class":1101},[1050,6063,5734],{"class":1831},[1050,6065,5848],{"class":1115},[1050,6067,3840],{"class":1080},[1050,6069,1102],{"class":1101},[1050,6071,6072],{"class":1105},"Server Alert: High Disk Usage",[1050,6074,3321],{"class":1101},[1050,6076,5860],{"class":3314},[1050,6078,6079],{"class":1052,"line":1277},[1050,6080,3503],{"class":3830},[1050,6082,6083],{"class":1052,"line":1285},[1050,6084,1070],{"emptyLinePlaceholder":1069},[1050,6086,6087],{"class":1052,"line":1291},[1050,6088,6089],{"class":1056},"# Check if Django app is running\n",[1050,6091,6092,6094,6097,6100,6103,6106,6109,6111],{"class":1052,"line":1296},[1050,6093,3831],{"class":3830},[1050,6095,6096],{"class":1831}," !",[1050,6098,6099],{"class":1115}," systemctl",[1050,6101,6102],{"class":1105}," is-active",[1050,6104,6105],{"class":1080}," --quiet",[1050,6107,6108],{"class":1105}," django_app",[1050,6110,3851],{"class":1122},[1050,6112,3854],{"class":3830},[1050,6114,6115,6117,6119,6122,6124,6126,6128,6130,6132,6135,6137],{"class":1052,"line":1302},[1050,6116,3859],{"class":1076},[1050,6118,1102],{"class":1101},[1050,6120,6121],{"class":1105},"Django application is not running!",[1050,6123,3321],{"class":1101},[1050,6125,5734],{"class":1831},[1050,6127,5848],{"class":1115},[1050,6129,3840],{"class":1080},[1050,6131,1102],{"class":1101},[1050,6133,6134],{"class":1105},"Server Alert: Django App Down",[1050,6136,3321],{"class":1101},[1050,6138,5860],{"class":3314},[1050,6140,6141],{"class":1052,"line":1314},[1050,6142,3503],{"class":3830},[1050,6144,6145],{"class":1052,"line":1325},[1050,6146,1070],{"emptyLinePlaceholder":1069},[1050,6148,6149],{"class":1052,"line":1333},[1050,6150,6151],{"class":1056},"# Check if Nginx is running\n",[1050,6153,6154,6156,6158,6160,6162,6164,6167,6169],{"class":1052,"line":1341},[1050,6155,3831],{"class":3830},[1050,6157,6096],{"class":1831},[1050,6159,6099],{"class":1115},[1050,6161,6102],{"class":1105},[1050,6163,6105],{"class":1080},[1050,6165,6166],{"class":1105}," nginx",[1050,6168,3851],{"class":1122},[1050,6170,3854],{"class":3830},[1050,6172,6173,6175,6177,6180,6182,6184,6186,6188,6190,6193,6195],{"class":1052,"line":1349},[1050,6174,3859],{"class":1076},[1050,6176,1102],{"class":1101},[1050,6178,6179],{"class":1105},"Nginx is not running!",[1050,6181,3321],{"class":1101},[1050,6183,5734],{"class":1831},[1050,6185,5848],{"class":1115},[1050,6187,3840],{"class":1080},[1050,6189,1102],{"class":1101},[1050,6191,6192],{"class":1105},"Server Alert: Nginx Down",[1050,6194,3321],{"class":1101},[1050,6196,5860],{"class":3314},[1050,6198,6199],{"class":1052,"line":1357},[1050,6200,3503],{"class":3830},[1050,6202,6203],{"class":1052,"line":1365},[1050,6204,1070],{"emptyLinePlaceholder":1069},[1050,6206,6207],{"class":1052,"line":1373},[1050,6208,6209],{"class":1056},"# Check database connectivity\n",[1050,6211,6212,6214,6216,6219,6221,6223,6225,6227,6229,6232,6234,6237,6239,6241,6243,6246,6248],{"class":1052,"line":1381},[1050,6213,3831],{"class":3830},[1050,6215,6096],{"class":1831},[1050,6217,6218],{"class":1115}," sudo",[1050,6220,2567],{"class":1080},[1050,6222,5429],{"class":1105},[1050,6224,2573],{"class":1105},[1050,6226,5256],{"class":1080},[1050,6228,6108],{"class":1105},[1050,6230,6231],{"class":1080}," -c",[1050,6233,1102],{"class":1101},[1050,6235,6236],{"class":1105},"SELECT 1;",[1050,6238,3321],{"class":1101},[1050,6240,1832],{"class":1831},[1050,6242,3848],{"class":1105},[1050,6244,6245],{"class":1831}," 2>&1",[1050,6247,3851],{"class":1122},[1050,6249,3854],{"class":3830},[1050,6251,6252,6254,6256,6259,6261,6263,6265,6267,6269,6272,6274],{"class":1052,"line":1389},[1050,6253,3859],{"class":1076},[1050,6255,1102],{"class":1101},[1050,6257,6258],{"class":1105},"Database connection failed!",[1050,6260,3321],{"class":1101},[1050,6262,5734],{"class":1831},[1050,6264,5848],{"class":1115},[1050,6266,3840],{"class":1080},[1050,6268,1102],{"class":1101},[1050,6270,6271],{"class":1105},"Server Alert: Database Connection Failed",[1050,6273,3321],{"class":1101},[1050,6275,5860],{"class":3314},[1050,6277,6278],{"class":1052,"line":1397},[1050,6279,3503],{"class":3830},[1026,6281,6282],{},"This comprehensive Linux server deployment guide provides everything needed to deploy Django applications securely and efficiently on Linux servers.",[6284,6285,6286],"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 .sJdAF, html code.shiki .sJdAF{--shiki-light:#6182B8;--shiki-default:#998418;--shiki-dark:#B8A965}html pre.shiki code .sz9Cv, html code.shiki .sz9Cv{--shiki-light:#91B859;--shiki-default:#A65E2B;--shiki-dark:#C99076}html pre.shiki code .sbYkP, html code.shiki .sbYkP{--shiki-light:#39ADB5;--shiki-default:#B5695977;--shiki-dark:#C98A7D77}html pre.shiki code .sTbE_, html code.shiki .sTbE_{--shiki-light:#91B859;--shiki-default:#B56959;--shiki-dark:#C98A7D}html pre.shiki code .sYn-s, html code.shiki .sYn-s{--shiki-light:#E2931D;--shiki-default:#59873A;--shiki-dark:#80A665}html pre.shiki code .soVBu, html code.shiki .soVBu{--shiki-light:#39ADB5;--shiki-default:#999999;--shiki-dark:#666666}html pre.shiki code .se3Ec, html code.shiki .se3Ec{--shiki-light:#90A4AE;--shiki-default:#A65E2B;--shiki-dark:#C99076}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sVsLi, html code.shiki .sVsLi{--shiki-light:#39ADB5;--shiki-default:#AB5959;--shiki-dark:#CB7676}html pre.shiki code .s7CZa, html code.shiki .s7CZa{--shiki-light:#F76D47;--shiki-default:#2F798A;--shiki-dark:#4C9A91}html pre.shiki code .sSC40, html code.shiki .sSC40{--shiki-light:#90A4AE;--shiki-default:#B07D48;--shiki-dark:#BD976A}html pre.shiki code .su_V2, html code.shiki .su_V2{--shiki-light:#90A4AE;--shiki-default:#B56959;--shiki-dark:#C98A7D}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}",{"title":1045,"searchDepth":1053,"depth":1060,"links":6288},[6289,6293,6297,6301,6306,6309],{"id":1032,"depth":1060,"text":1033,"children":6290},[6291,6292],{"id":1037,"depth":1066,"text":1038},{"id":1671,"depth":1066,"text":1672},{"id":2506,"depth":1060,"text":2507,"children":6294},[6295,6296],{"id":2510,"depth":1066,"text":2511},{"id":2903,"depth":1066,"text":2904},{"id":3271,"depth":1060,"text":3272,"children":6298},[6299,6300],{"id":3275,"depth":1066,"text":3276},{"id":3911,"depth":1066,"text":3912},{"id":4167,"depth":1060,"text":4168,"children":6302},[6303,6304,6305],{"id":4171,"depth":1066,"text":4172},{"id":4536,"depth":1066,"text":4537},{"id":5073,"depth":1066,"text":5074},{"id":5169,"depth":1060,"text":5170,"children":6307},[6308],{"id":5173,"depth":1066,"text":5174},{"id":5363,"depth":1060,"text":767,"children":6310},[6311,6312],{"id":5366,"depth":1066,"text":5367},{"id":5642,"depth":1066,"text":5643},"md",null,{},{"title":751,"description":1028},"Nj7hl4646mxUpBRAw8KqZdhur6aHumTYYJ1yyGlu0cw",[6319,6321],{"title":747,"path":748,"stem":749,"description":6320,"children":-1},"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.",{"title":755,"path":756,"stem":757,"description":6322,"children":-1},"Docker containerization provides consistent, portable, and scalable deployment environments for Django applications. This chapter covers Docker fundamentals, multi-stage builds, container orchestration, and production-ready Docker configurations for Django applications.",1772474953109]