我是 Python Django 的新手,我已经成功创建了我的应用程序,当我尝试在 Ubuntu 16.04 上托管我的 Django 应用程序时,它无法正常工作,我尝试了几种方法并用 Google 搜索了很多,请帮助摆脱这种情况。
\n\n我按照这个 URL How To Set Up Django with Postgres, Nginx, and Gunicorn on Ubuntu我已经正确完成了所有设置,但仍然没有成功。在这里我分享必要的文件供您参考,如果我遗漏了什么,请告诉我。
\n\netc/nginx/站点可用
\n\nserver {\n listen *:91;\n server_name ip-address;\n location = /favicon.ico { access_log off; log_not_found off; }\n location /static/ {\n root /home/iradmin/django/scm;\n }\n location / {\n include proxy_params;\n proxy_pass http://unix:/home/iradmin/django/scm/scm.sock;\n }\n}\nRun Code Online (Sandbox Code Playgroud)\n\n等/inint/gunicorn.conf
\n\ndecription "Gunicorn application server handling scm"\nstart on runlevel [2345]\nstop on runlevel [!2345]\nrespawn\nsetuid iradmin\nsetgid www-data\nchdir /home/iradmin/django/scm/\nexec python3venv/bin/gunicorn --workers 3 …Run Code Online (Sandbox Code Playgroud)