{"id":280,"date":"2026-05-30T14:25:30","date_gmt":"2026-05-30T08:55:30","guid":{"rendered":"https:\/\/nivohost.com\/blog\/?p=280"},"modified":"2026-05-30T14:27:51","modified_gmt":"2026-05-30T08:57:51","slug":"how-to-deploy-host-python-flask-or-django-application","status":"publish","type":"post","link":"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/","title":{"rendered":"How To Deploy\/Host Python Flask Or Django Application"},"content":{"rendered":"\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#How_to_Deploy_and_Host_Python_Flask_or_Django_Applications\" >How to Deploy and Host Python Flask or Django Applications<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#What_is_Flask\" >What is Flask?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Key_Features\" >Key Features<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#What_is_Django\" >What is Django?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Key_Features-2\" >Key Features<\/a><\/li><\/ul><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Requirements_Before_Deployment\" >Requirements Before Deployment<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Deploying_a_Flask_Application\" >Deploying a Flask Application<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Deploy_Today_Only_1Month\" >Deploy Today Only $1\/Month<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Step_1_Prepare_Your_Flask_Project\" >Step 1: Prepare Your Flask Project<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Step_2_Create_passenger_wsgipy\" >Step 2: Create passenger_wsgi.py<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Step_3_Upload_Application_Files\" >Step 3: Upload Application Files<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Step_4_Add_Application\" >Step 4: Add Application<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Step_5_Install_Dependencies\" >Step 5: Install Dependencies<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Step_6_Start_Application\" >Step 6: Start Application<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Deploying_a_Django_Application\" >Deploying a Django Application<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Step_1_Create_Django_Project\" >Step 1: Create Django Project<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Step_2_Configure_Port\" >Step 2: Configure Port<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Step_3_Upload_Project\" >Step 3: Upload Project<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Step_4_Add_Django_Application\" >Step 4: Add Django Application<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Step_5_Install_Dependencies-2\" >Step 5: Install Dependencies<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Step_6_Configure_Production_Settings\" >Step 6: Configure Production Settings<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Step_7_Restart_Application\" >Step 7: Restart Application<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Host_on_Nivohost\" >Host on Nivohost<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Best_Practices_for_Production_Deployment\" >Best Practices for Production Deployment<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Use_Virtual_Environments\" >Use Virtual Environments<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Store_Secrets_in_Environment_Variables\" >Store Secrets in Environment Variables<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-27\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Enable_HTTPS\" >Enable HTTPS<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-28\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Use_Gunicorn\" >Use Gunicorn<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-29\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Configure_Reverse_Proxy\" >Configure Reverse Proxy<\/a><\/li><\/ul><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-30\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Useful_Video_Tutorials\" >Useful Video Tutorials<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-31\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Flask_Deployment_Tutorials\" >Flask Deployment Tutorials<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-32\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Django_Deployment_Tutorials\" >Django Deployment Tutorials<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-33\" href=\"https:\/\/nivohost.com\/blog\/how-to-deploy-host-python-flask-or-django-application\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Deploy_and_Host_Python_Flask_or_Django_Applications\"><\/span>How to Deploy and Host Python Flask or Django Applications<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Python web frameworks like Flask and Django are among the most popular choices for building modern web applications. Once your application is ready, the next step is deploying it to a live server so users can access it online.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this guide, you&#8217;ll learn how to deploy and host Flask and Django applications, including deployment using Webuzo Application Manager and other popular hosting platforms.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_Flask\"><\/span>What is Flask?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Flask is a lightweight Python web framework that provides flexibility and simplicity for building web applications and APIs.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Key_Features\"><\/span>Key Features<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Lightweight and easy to learn<\/li>\n\n\n\n<li>Minimal setup requirements<\/li>\n\n\n\n<li>Great for APIs and small-to-medium projects<\/li>\n\n\n\n<li>Highly customizable<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_Django\"><\/span>What is Django?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Django is a high-level Python framework designed for rapid development and clean architecture.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Key_Features-2\"><\/span>Key Features<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Built-in admin panel<\/li>\n\n\n\n<li>Authentication system<\/li>\n\n\n\n<li>ORM (Object Relational Mapper)<\/li>\n\n\n\n<li>Security features<\/li>\n\n\n\n<li>Scalable architecture<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Requirements_Before_Deployment\"><\/span>Requirements Before Deployment<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Before hosting your application, ensure you have:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Python installed<\/li>\n\n\n\n<li>Virtual environment configured<\/li>\n\n\n\n<li>Application tested locally<\/li>\n\n\n\n<li>Domain name (optional)<\/li>\n\n\n\n<li>VPS, Cloud Server, or hosting account<\/li>\n\n\n\n<li>Git installed (recommended)<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Deploying_a_Flask_Application\"><\/span>Deploying a Flask Application<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">We provides an Application Manager that allows users to host Python applications using Passenger.<\/p>\n\n\n\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"9\" class=\"elementor elementor-9\">\n\t\t\t\t<div class=\"elementor-element elementor-element-1b00358 e-flex e-con-boxed e-con e-parent\" data-id=\"1b00358\" data-element_type=\"container\" data-e-type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t<div class=\"elementor-element elementor-element-7d5a833 e-con-full e-flex e-con e-child\" data-id=\"7d5a833\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-59cd196 elementor-widget elementor-widget-image\" data-id=\"59cd196\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"1019\" src=\"https:\/\/nivohost.com\/blog\/wp-content\/uploads\/2025\/04\/undraw_cloud-hosting_tfeh-1024x1019.png\" class=\"attachment-large size-large wp-image-12\" alt=\"\" srcset=\"https:\/\/nivohost.com\/blog\/wp-content\/uploads\/2025\/04\/undraw_cloud-hosting_tfeh-1024x1019.png 1024w, https:\/\/nivohost.com\/blog\/wp-content\/uploads\/2025\/04\/undraw_cloud-hosting_tfeh-300x300.png 300w, https:\/\/nivohost.com\/blog\/wp-content\/uploads\/2025\/04\/undraw_cloud-hosting_tfeh-150x150.png 150w, https:\/\/nivohost.com\/blog\/wp-content\/uploads\/2025\/04\/undraw_cloud-hosting_tfeh-768x765.png 768w, https:\/\/nivohost.com\/blog\/wp-content\/uploads\/2025\/04\/undraw_cloud-hosting_tfeh.png 1344w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-25533e8 e-con-full e-flex e-con e-child\" data-id=\"25533e8\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-ced65c1 elementor-widget elementor-widget-heading\" data-id=\"ced65c1\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\"><span class=\"ez-toc-section\" id=\"Deploy_Today_Only_1Month\"><\/span>Deploy Today Only $1\/Month<span class=\"ez-toc-section-end\"><\/span><\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8de33b9 elementor-widget elementor-widget-text-editor\" data-id=\"8de33b9\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Nivohost Offers the best features like python, nodejs, Website Builder, Litespeed at affordable prices.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-0214c4b e-con-full e-flex e-con e-child\" data-id=\"0214c4b\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-cc622f1 elementor-widget elementor-widget-button\" data-id=\"cc622f1\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"button.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-button-wrapper\">\n\t\t\t\t\t<a class=\"elementor-button elementor-button-link elementor-size-sm\" href=\"https:\/\/nivohost.com\/web-hosting\">\n\t\t\t\t\t\t<span class=\"elementor-button-content-wrapper\">\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-button-text\">View Hosting Plans<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/a>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_1_Prepare_Your_Flask_Project\"><\/span>Step 1: Prepare Your Flask Project<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Example structure:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>myflaskapp\/\n\u2502\n\u251c\u2500\u2500 app.py\n\u251c\u2500\u2500 requirements.txt\n\u2514\u2500\u2500 passenger_wsgi.py<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Install dependencies:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install flask\npip freeze &gt; requirements.txt<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_2_Create_passenger_wsgipy\"><\/span>Step 2: Create passenger_wsgi.py<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Passenger requires a WSGI entry file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from app import app as application<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Webuzo documentation also demonstrates creating a <code>passenger_wsgi.py<\/code> file for Flask applications.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_3_Upload_Application_Files\"><\/span>Step 3: Upload Application Files<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Upload your Flask project to your hosting account using:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>File Manager<\/li>\n\n\n\n<li>Git Clone<\/li>\n\n\n\n<li>FTP\/SFTP<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_4_Add_Application\"><\/span>Step 4: Add Application<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Login to Webuzo Enduser Panel<\/li>\n\n\n\n<li>Open Applications<\/li>\n\n\n\n<li>Click Add Application<\/li>\n\n\n\n<li>Select Passenger<\/li>\n\n\n\n<li>Choose Python<\/li>\n\n\n\n<li>Enter:\n<ul class=\"wp-block-list\">\n<li>Application Path<\/li>\n\n\n\n<li>Startup File<\/li>\n\n\n\n<li>Port Number<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_5_Install_Dependencies\"><\/span>Step 5: Install Dependencies<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Open terminal:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install -r requirements.txt<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_6_Start_Application\"><\/span>Step 6: Start Application<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Restart the application from Webuzo Application Manager.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Official Flask Guide:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-webuzo wp-block-embed-webuzo\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"0NM6suRO9w\"><a href=\"https:\/\/webuzo.com\/docs\/enduser-applications\/how-to-setup-python-flask-with-application-manager\" target=\"_blank\" rel=\"noopener\">How to setup Python (Flask) with Application Manager<\/a><\/blockquote><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"\u201cHow to setup Python (Flask) with Application Manager\u201d \u2014 Webuzo\" src=\"https:\/\/webuzo.com\/docs\/enduser-applications\/how-to-setup-python-flask-with-application-manager\/embed\/#?secret=0NM6suRO9w\" data-secret=\"0NM6suRO9w\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Deploying_a_Django_Application\"><\/span>Deploying a Django Application<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_1_Create_Django_Project\"><\/span>Step 1: Create Django Project<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install django\n\ndjango-admin startproject myproject<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Run locally:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python manage.py runserver<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_2_Configure_Port\"><\/span>Step 2: Configure Port<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">According to documentation, you should modify the default Django development port.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from django.core.management.commands.runserver import Command as runserver\n\nrunserver.default_port = \"30001\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Replace the port with the one provided.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_3_Upload_Project\"><\/span>Step 3: Upload Project<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Upload all project files to your hosting account.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_4_Add_Django_Application\"><\/span>Step 4: Add Django Application<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In :<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Open Applications<\/li>\n\n\n\n<li>Click Add Application<\/li>\n\n\n\n<li>Select Python\/Django<\/li>\n\n\n\n<li>Configure:\n<ul class=\"wp-block-list\">\n<li>Application Path<\/li>\n\n\n\n<li>Startup Command<\/li>\n\n\n\n<li>Port<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_5_Install_Dependencies-2\"><\/span>Step 5: Install Dependencies<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install -r requirements.txt<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_6_Configure_Production_Settings\"><\/span>Step 6: Configure Production Settings<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Edit:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ALLOWED_HOSTS = &#091;'yourdomain.com']\nDEBUG = False<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Collect static files:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python manage.py collectstatic<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_7_Restart_Application\"><\/span>Step 7: Restart Application<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Restart the application using Application Manager.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Official Django Guide:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-webuzo wp-block-embed-webuzo\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"taAw8a6XEB\"><a href=\"https:\/\/webuzo.com\/docs\/enduser-applications\/how-to-setup-python-django-with-application-manager\" target=\"_blank\" rel=\"noopener\">How to setup Python (Django) with Application Manager<\/a><\/blockquote><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"\u201cHow to setup Python (Django) with Application Manager\u201d \u2014 Webuzo\" src=\"https:\/\/webuzo.com\/docs\/enduser-applications\/how-to-setup-python-django-with-application-manager\/embed\/#?secret=taAw8a6XEB\" data-secret=\"taAw8a6XEB\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Host_on_Nivohost\"><\/span>Host on Nivohost<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Features:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Full server control<\/li>\n\n\n\n<li>High scalability<\/li>\n\n\n\n<li>Enterprise-level hosting<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Website:<\/p>\n\n\n\n<figure class=\"wp-block-embed\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/aws.amazon.com\/ec2\n<\/div><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Best_Practices_for_Production_Deployment\"><\/span>Best Practices for Production Deployment<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Use_Virtual_Environments\"><\/span>Use Virtual Environments<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>python -m venv venv\nsource venv\/bin\/activate<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Store_Secrets_in_Environment_Variables\"><\/span>Store Secrets in Environment Variables<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Avoid:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SECRET_KEY = \"mypassword\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Use:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import os\n\nSECRET_KEY = os.getenv(\"SECRET_KEY\")<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Enable_HTTPS\"><\/span>Enable HTTPS<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Let&#8217;s Encrypt<\/li>\n\n\n\n<li>Cloudflare SSL<\/li>\n\n\n\n<li>Hosting provider SSL<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Use_Gunicorn\"><\/span>Use Gunicorn<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">For Flask:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gunicorn app:app<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For Django:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gunicorn myproject.wsgi<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Configure_Reverse_Proxy\"><\/span>Configure Reverse Proxy<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Nginx<\/li>\n\n\n\n<li>Apache<\/li>\n\n\n\n<li>Passenger<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Useful_Video_Tutorials\"><\/span>Useful Video Tutorials<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Flask_Deployment_Tutorials\"><\/span>Flask Deployment Tutorials<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Flask Deployment on Nivohost<br><a href=\"https:\/\/www.youtube.com\/nivohost1\" target=\"_blank\" rel=\"noopener\">https:\/\/www.youtube.com\/nivohost1<\/a><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Django_Deployment_Tutorials\"><\/span>Django Deployment Tutorials<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Django Deployment for Beginners<br><a href=\"https:\/\/www.youtube.com\/nivohost1\" target=\"_blank\" rel=\"noopener\">https:\/\/www.youtube.com\/nivohost1<\/a><\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Deploying Flask and Django applications has become easier thanks to platforms like Nivohost, shared hosting ( that supports python) and cloud VPS providers. If you&#8217;re already using Nivohost hosting, its Application Manager offers a convenient way to deploy Python applications without manually configuring complex server settings.<\/p>\n","protected":false},"excerpt":{"rendered":"How to Deploy and Host Python Flask or Django Applications Python web frameworks like Flask and Django are&hellip;","protected":false},"author":1,"featured_media":281,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"csco_singular_sidebar":"","csco_page_header_type":"","csco_page_load_nextpost":"","csco_post_video_location":[],"csco_post_video_location_hash":"","csco_post_video_url":"","csco_post_video_bg_start_time":0,"csco_post_video_bg_end_time":0,"csco_post_video_bg_volume":false,"footnotes":""},"categories":[2],"tags":[13,10,11,12],"class_list":["post-280","post","type-post","status-publish","format-standard","has-post-thumbnail","category-tutorial","tag-host-python-website","tag-python","tag-python-flask","tag-python-host","cs-entry","cs-video-wrap"],"_links":{"self":[{"href":"https:\/\/nivohost.com\/blog\/wp-json\/wp\/v2\/posts\/280","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nivohost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nivohost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nivohost.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nivohost.com\/blog\/wp-json\/wp\/v2\/comments?post=280"}],"version-history":[{"count":3,"href":"https:\/\/nivohost.com\/blog\/wp-json\/wp\/v2\/posts\/280\/revisions"}],"predecessor-version":[{"id":292,"href":"https:\/\/nivohost.com\/blog\/wp-json\/wp\/v2\/posts\/280\/revisions\/292"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nivohost.com\/blog\/wp-json\/wp\/v2\/media\/281"}],"wp:attachment":[{"href":"https:\/\/nivohost.com\/blog\/wp-json\/wp\/v2\/media?parent=280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nivohost.com\/blog\/wp-json\/wp\/v2\/categories?post=280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nivohost.com\/blog\/wp-json\/wp\/v2\/tags?post=280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}