First, export-dependent your django site needed
Execute the following command in your website root directory (ie the directory where manage.py)
pip freeze > requirements.txt
After that, the file will generate a requirements.txt indicating the export success
Second, upload your website code
Create a directory to store django website code, will pass up your website.
Third, open the pagoda panel software store, install the "Python Project Manager"
And install python need, here is the installation of python version 3.7.2.
Fourth, entering Python manager, and configure your own website
Path: Enter the web root directory
Start: Select uwsgi
startup file / folder: Select the folder on the line, the address of your website at the address of the same name (the directory containing the wsgi.py)
Five, then click OK
Next, Python Manager will automatically install dependent on internal documents "requirements.txt". While generating a "Project name _env" in your site's root folder, such as me, then it generates a "my_first_site_venv" folder.
Then, they configure a success.
Deployment debugging
If you have questions, you can see the following manner debugging.
Above, we mentioned the "Project name _env" under the root folder. This folder is the manager to give you auto-generated virtual environment, when you put the deleted items, it will be deleted together.
Well, he had what use is it?
The site is running requires the corresponding version of python environment, because we built python linux server is version 2.7, does not meet very often. And we can not move python environmental systems, as other software to use, if you hand cheap, upgrade it, then our server probably can not run. This time, the manager gave us a virtual environment is very critical. For example, I now choose python version is 3.7.2, then we can use python virtual environment is 3.7.2.
Use you open Manager, they are also described. Here I will introduce how to use specific.
Use
1. Go to the root directory of your site, as follows
cd /home/www/wwwroot/mysite
2. Use the "bin / activate" in the source file to run the virtual environment
source my_first_site_venv/bin/activate
You will see the beginning (my_first_site_env) of the command prefix, then you have entered the virtual environment.
3. Test versions of python virtual environment
python -V
4, this case can be used
python manage.py runserver
Start your Web site to debug. Report what is wrong to see the site, processed, if you can run here, then, that there is essentially manager can properly started.