正式运行时将这句代码加入到uwsgi.ini文件中,访问日志就会后台输出到uwsgi.log
此时django已经能访问。
第七步,配置nginx
修改nginx的默认配置文件/etc/nginx/sites-enabled/default
| server { # the port your site will be served on listen 80; # the domain name it will serve for server_name 127.0.0.1; # substitute your machine's IP address or FQDN charset utf-8; # max upload size client_max_body_size 75M; # adjust to taste # Django media location /media { alias /home/ubuntu/mysite/media; # your Django project's media files - amend as required } location /static { alias /home/ubuntu/mysite/static; # your Django project's static files - amend as required } # Finally, send all non-media requests to the Django server. location / { include uwsgi_params; # the uwsgi_params file you installed uwsgi_pass 127.0.0.1:8001;#此处跟uwsgi配置文件保持一致 } } |
记得修改测试时的uwsgi.ini的配置。
第八步,运行
重启nginx,运行uwsgi.
大功告成
以上这篇Django在Ubuntu14.04的部署方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持易采站长站。








