首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么我的uWSGI找不到我的Django应用程序?

为什么我的uWSGI找不到我的Django应用程序?
EN

Stack Overflow用户
提问于 2012-03-29 14:37:21
回答 1查看 10.8K关注 0票数 2

我在这个论坛上经历过许多类似的问题,但我的问题仍然困扰着我。

我的项目布局

代码语言:javascript
复制
/home/django/apps
    |- movehere_env    <--- Virtualenv. Everthing, including uwsgi is installed in it.
    |- movehere_store
        |- settings.py
        |- apps
        |- Other project stuff
        |- prod      <--- Stores settings for prod env
            |- uwsgi.ini <--- uwsgi ini file
            |- wsgi.py   <--- Python code which has the Django application.

uwsgi.ini

代码语言:javascript
复制
[uwsgi]
socket = /tmp/movehere_store_uwsgi.sock
chdir = /home/django/apps
module = 'movehere_store.prod.wsgi:application'
master = True
pidfile = /tmp/movehere_store.pid
vacuum = True
max-requests = 5000
daemonize = /var/log/uwsgi/uwsgi.log
virtualenv = /home/django/apps/movehere_env
#harakiri = 20
processes  = 5
pp = /home/django/apps

uwsgi.log

代码语言:javascript
复制
Python version: 2.6.5 (r265:79063, Jun 25 2011, 08:29:14)  [GCC 4.4.4 20100726 (Red Hat 4.4.4-13)]
Set PythonHome to /home/django/apps/movehere_env
Python main interpreter initialized at 0x9922be0
your server socket listen backlog is limited to 100 connections
*** Operational MODE: preforking ***
added /home/django/apps/ to pythonpath.
ImportError: No module named 'movehere_store.prod.wsgi
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 master process (pid: 15050)
spawned uWSGI worker 1 (pid: 15051, cores: 1)
spawned uWSGI worker 2 (pid: 15052, cores: 1)
spawned uWSGI worker 3 (pid: 15053, cores: 1)
spawned uWSGI worker 4 (pid: 15054, cores: 1)
spawned uWSGI worker 5 (pid: 15055, cores: 1)

我如何启动uwsgi

代码语言:javascript
复制
/home/django/apps/movehere_env/bin/uwsgi --ini /home/django/apps/movehere_store/prod/uwsgi.ini
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-03-29 14:41:45

您不应该将引号放在uwsgi.ini中的模块参数周围。它是Django文档中的一个bug,已经修复了。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9927604

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档