{"id":2783,"date":"2026-01-29T18:32:29","date_gmt":"2026-01-29T12:47:29","guid":{"rendered":"https:\/\/linkupnepal.com\/?p=2783"},"modified":"2026-04-20T19:59:26","modified_gmt":"2026-04-20T14:14:26","slug":"how-to-deploy-your-python-project-using-python-manager-django","status":"publish","type":"post","link":"https:\/\/kumarsaroj.com.np\/index.php\/2026\/01\/29\/how-to-deploy-your-python-project-using-python-manager-django\/","title":{"rendered":"How to deploy your python project using python manager (django)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>Our test project:&nbsp;<a href=\"https:\/\/github.com\/liangliangyy\/DjangoBlog\" rel=\"noreferrer noopener\" target=\"_blank\">https:\/\/github.com\/liangliangyy\/DjangoBlog<\/a><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>panel: aaPanel<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>1. Go to the directory where you will store the code<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>`cd \/www\/python\/flask`<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>2. Run the git clone command on your terminal to get the project<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>git clone https:\/\/github.com\/liangliangyy\/DjangoBlog.git<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>3. Install the python version your project needs<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.aapanel.com\/forum\/assets\/files\/2019-08-29\/1567065822-217955-pythonversion.png\" alt=\"how to deploy python in aapanel\" title=\"\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>4.Start adding python projects<\/strong><br><img decoding=\"async\" src=\"https:\/\/www.aapanel.com\/forum\/assets\/files\/2019-08-29\/1567065900-655779-django.png\" alt=\"\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Parameter Description:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Name:&nbsp;<em>Give your project a name<\/em><\/li>\n\n\n\n<li>Path:&nbsp;<em>Select the root directory of the project<\/em><\/li>\n\n\n\n<li>Version:&nbsp;<em>Choose the python version your project needs<\/em><\/li>\n\n\n\n<li>Framework:&nbsp;<em>The project project framework, my project here is Flask, so choose django<\/em><\/li>\n\n\n\n<li>Startup Mode:&nbsp;<em>Choose gunicorn here, You can switch other options according to your needs<\/em>.<\/li>\n\n\n\n<li>Startuo file\/dir:&nbsp;<em>In general,&nbsp;<strong>diango selects the project directory<\/strong>&nbsp;to start, and flask selects the py file to start.<\/em><\/li>\n\n\n\n<li>Install module now:&nbsp;<em>When adding a project, install the required modules according to the documentation of the project root directory requirements.txt.<\/em><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>When we finish project creation, we can\u2019t open the project normally.We need to initialize the project<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>5. According to the project requirements, we first create the databases and modify the project database configuration.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">create a database:<br><img decoding=\"async\" src=\"https:\/\/www.aapanel.com\/forum\/assets\/files\/2019-08-29\/1567066056-920077-createdatabase.png\" alt=\"\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>6.modify the project database configuration<\/strong><br><img decoding=\"async\" src=\"https:\/\/www.aapanel.com\/forum\/assets\/files\/2019-08-29\/1567066100-88809-env.png\" alt=\"\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The default database configuration is to get the database account and other information from the environment variables, we refer to the installation tutorial to remove the os.environ.get method<br><img decoding=\"async\" src=\"https:\/\/www.aapanel.com\/forum\/assets\/files\/2019-08-29\/1567066266-388399-modifydatabase.png\" alt=\"\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Go into the project\u2019s virtual environment and execute the following command<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Go into the project\u2019s virtual environment:<br><code>source \/www\/python\/DjangoBlog\/django_blog_venv\/bin\/activate<\/code><br><img decoding=\"async\" src=\"https:\/\/www.aapanel.com\/forum\/assets\/files\/2019-08-29\/1567066316-934416-venv.png\" alt=\"\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now execute the following command :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/www\/python\/DjangoBlog\/ #your project dir\n.\/manage.py makemigrations\n.\/manage.py migrate<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Create the SuperAdmin:<br><code>.\/manage.py createsuperuser<\/code><br>Create test data:<br><code>.\/manage.py create_testdata<\/code><br>Collect static files:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/manage.py collectstatic --noinput\n.\/manage.py compress --force<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Now we can access our blog using&nbsp;<a href=\"http:\/\/192.168.1.199:8099\/\" rel=\"noreferrer noopener\" target=\"_blank\">http:\/\/192.168.1.199:8099<\/a><\/strong><\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/cp.linkupnepal.com\/index.php?rp=\/store\/cloud-vps\">Order Now<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Our test project:&nbsp;https:\/\/github.com\/liangliangyy\/DjangoBlog panel: aaPanel 1. Go to the directory where you will store the code 2. Run the git clone command on your terminal to get the project git clone https:\/\/github.com\/liangliangyy\/DjangoBlog.git 3. Install the python version your project needs 4.Start adding python projects Parameter Description: When we finish project creation, we can\u2019t open the&#8230;<\/p>\n","protected":false},"author":1,"featured_media":2786,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"footnotes":""},"categories":[7],"tags":[33,9,34,35,36],"class_list":["post-2783","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vps-hosting","tag-aapanel","tag-hosting","tag-how-to","tag-process","tag-python"],"_links":{"self":[{"href":"https:\/\/kumarsaroj.com.np\/index.php\/wp-json\/wp\/v2\/posts\/2783","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kumarsaroj.com.np\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kumarsaroj.com.np\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kumarsaroj.com.np\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kumarsaroj.com.np\/index.php\/wp-json\/wp\/v2\/comments?post=2783"}],"version-history":[{"count":2,"href":"https:\/\/kumarsaroj.com.np\/index.php\/wp-json\/wp\/v2\/posts\/2783\/revisions"}],"predecessor-version":[{"id":3696,"href":"https:\/\/kumarsaroj.com.np\/index.php\/wp-json\/wp\/v2\/posts\/2783\/revisions\/3696"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kumarsaroj.com.np\/index.php\/wp-json\/wp\/v2\/media\/2786"}],"wp:attachment":[{"href":"https:\/\/kumarsaroj.com.np\/index.php\/wp-json\/wp\/v2\/media?parent=2783"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kumarsaroj.com.np\/index.php\/wp-json\/wp\/v2\/categories?post=2783"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kumarsaroj.com.np\/index.php\/wp-json\/wp\/v2\/tags?post=2783"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}