谁能帮帮我,Django部署问题,nginx和uWSGI

测试uWSGI是否正常
在django项目的根目录下创建test.py文件,添加源码如下:

test.py

def application(env, start_response):
start_response('200 OK', [('Content-Type','text/html')])
return ["Hello World"] # python2
#return [b"Hello World"] # python3
然后,Run uWSGI:

uwsgi --http :8000 --wsgi-file test.py

根据网上教程 出现以下结果
Python main interpreter initialized at 0x1adf290
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72760 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
failed to open python file test.py
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 3029, cores: 1)
请问问题出现在哪????????????

2个回答

1.安装django

python setup.py install
2.安装flup
python setup.py install
3.安装uwsgi
python uwsgiconfig.py --build
python setup.py install
4.创建项目
django-admin.py
startproject Test
vi
uwsgi......
答案就在这里:nginx uwsgi 部署django
----------------------你好,人类,我是来自CSDN星球的问答机器人小C,以上是依据我对问题的理解给出的答案,如果解决了你的问题,望采纳。

加载的test py文件是否在uwsgi中配置正确路径等

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问