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
<br />In order to manage the vehicles enteri...
Table of contents Nginx load balancing configurat...
Result:Implementation Code html <div class=...
Use canvas to write a colorful clock! 1. Title (1...
TypeScript Bundling webpack integration Usually, ...
In the process of team development, it is essenti...
Preface Since the most important data structure i...
1. Download the virtual machine version 15.5.1 I ...
Added anti-crawler policy file: vim /usr/www/serv...
The official source code of monaco-editor-vue is ...
<br />There is no road in the world. When mo...
Tutorial Series MySQL series: Basic concepts of M...
Vue calls the PC camera to take pictures in real ...
Table of contents Tutorial Series 1. User Managem...
This article example shares the specific code for...