Basic Environment
Send the Django project code to the server There are two ways to put the code on the server:
Note: Create a new folder in the directory: Creating a Python (Django) Project Now we start creating a python project. Open the Python Project Manager on the homepage and click Add Project. Fill data: Set up website service and configure static file proxy We have already started the above operations internally. The next step is to set it up as a website service, provide external access, and set up nginx proxy to load static files. In the Python Project Manager, click [Mapping] and set the domain name (or external IP). After the mapping is successful, check it in the [Website] menu on the panel sidebar. (It can be accessed externally at this point. But there are no static files) Click on the domain name or IP we just mapped on the website, a pop-up window will appear, select Reverse Proxy -> Configuration File Find a gap to add configuration for static files and media resources. About static files: It is the location where css and js files are stored. Named static in the Django framework. https://my.openwrite.cn/logout About media resources: For example, the storage location of pictures uploaded by users is generally named media. Just write whatever name you set. location /static/ { alias /www/wwwroot/myblog/static/; } location /media/ { alias /www/wwwroot/myblog/media/; } Just follow the file path settings. You only need to replace the red box with your path, and leave the rest unchanged. Next, go back to the home page of the panel, click Python Project Manager, and select the project to restart. After the restart is complete, click Nginx to reload the configuration. At this point, everything is fine! You can access it through the domain name or IP you set. This is the end of this article about the detailed tutorial on how to deploy Django projects on CentOS. For more information about how to deploy Django projects on CentOS, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: js implements shopping cart addition and subtraction and price calculation
>>: MySql Installer 8.0.18 Visual Installation Tutorial with Pictures and Text
Linux often encounters situations such as adding ...
This case is based on CentOS 7 system Suitable fo...
The logs in MySQL include: error log, binary log,...
Scenario simulation: Some domestic companies need...
Enter ssh and enter the following command to rese...
First of all, the formation of web page style main...
Basic Use <!DOCTYPE html> <html lang=&qu...
1. Server setup The remote repository is actually...
Table of contents What is a partition table Parti...
Preface If you are going to interview for a Linux...
Table of contents Features of etcd There are thre...
Table of contents 1. Common mistakes made by begi...
Preface: This article mainly introduces the query...
Table of contents Preface: Ubuntu 18.04 changes a...
Date-type single-row functions in MySQL: CURDATE(...