After the django backend API is developed and deployed, how can the front-end code be deployed to the same server?

now after I use django restfulframework to write the back-end code and deploy it to the server through nginx+uwsgi, enter ip to display the API page. Now, after the front-end code is taken, how to deploy it and enter ip to display the home page instead of the API page.

Mar.15,2021

according to your description, it is a separate working mode, back-end api interface, front-end invocation. So you also need a server to deploy on your front end.
if your front end is a framework such as vue,angular, you can deploy it directly according to the official website documentation.


you are asking about the nginx configuration. Configure multiple server modules. If you want to use a domain name to point to the front-end and back-end respectively, the server_name configuration can be different; if you want to use the same IP, the listening port will be different. All of the above will have cross-domain problems, and you need to solve the cross-domain problems again.
if you want to use the same domain name or the same IP+ port, you need to configure different location, in a server to point to the front and back ends.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36f01-2c037.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36f01-2c037.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?