How to run django with nginx on a windows machine?

前端 未结 4 1736
一生所求
一生所求 2020-12-29 13:37

I have a django project. I have installed nginx server. I want to run nginx along with django on windows machine. I have tried a few blogs Nginx Django Uwsgi. But all of the

4条回答
  •  情歌与酒
    2020-12-29 14:05

    After the Django1.9+, the FastCGI support via the runfcgi management command is removed. So you have to use old version django, or use the mod_wsgi + apache.

    If you only want to develop the django code, then you can just edit nginx.conf add proxy_pass http://127.0.0.1:8000 into the location option. For example:

        location /api/ {
            proxy_pass http://127.0.0.1:8000; 
        }
    
        location /static/ {
            proxy_pass http://127.0.0.1:8000; 
        }
    

提交回复
热议问题