主机论坛_虚拟主机_美国主机_美国虚拟主机_云主机技术_全球主机交流聚集地—Web Hosting Talk 中文站

找回密码
立即注册
发新帖

0

收听

4

听众

547

主题
发表于 2022-3-21 16:24:01 | 查看: 123| 回复: 0
def application(env, start_response):  start_response('200 OK', [('Content-Type','text/html')])  return ["Hello World"]uwsgi --http :8001 --plugin python --wsgi-file test.pypython manage.py runserver 0.0.0.0:8002uwsgi --http:8001 --plugin python --module mysite.wsgi# mysite_uwsgi.ini file  [uwsgi]  socket = 127.0.0.1:3400  # Django-related settings  # the django project directory (full path)  chdir      = /home/ubuntu/mysite  # Django's wsgi file  module     = mysite.wsgi  # process-related settings  # master  master     = true  # maximum number of worker processes  processes    = 2  threads = 2  max-requests = 6000  # ... with appropriate permissions - may be needed  chmod-socket  = 664  # clear environment on exit  vacuum     = truedaemonize = /home/ubuntu/mysite/uwsgi.logserver {  # 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的部署方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持Vecloud。
企业专线-MPLS VPN-SDWAN组网-云专线http://www.elinkcloud.cn/

收藏回复 显示全部楼层 道具 举报

您需要登录后才可以回帖 登录 | 立即注册

Archiver|手机版|小黑屋|WebHostingTalk中文站

GMT+8, 2024-4-29 22:08 , Processed in 0.066622 second(s), 23 queries .

Powered by Discuz! X3.4

Copyright © 2001-2024, Tencent Cloud.

快速回复 返回顶部 返回列表