Django未能找到应用程序

时间:2009-06-29 05:19:31

标签: python django

我一直在我的本地计算机上使用django应用程序已经有一段时间了,我正试图将它移动到一个mediatemple容器,当我尝试启动django时我遇到了问题。它给了我这个追溯:

application failed to start, starting manage.py fastcgi failed:Traceback
(most recent call last): File "manage.py", line 11, in ?
execute_manager(settings) File
"/home/58626/data/python/lib/django/core/management/__init__.py", line 340,
in execute_manager utility.execute() File
"/home/58626/data/python/lib/django/core/management/__init__.py", line 295,
in execute self.fetch_command(subcommand).run_from_argv(self.argv) File
"/home/58626/data/python/lib/django/core/management/base.py", line 192, in
run_from_argv self.execute(*args, **options.__dict__) File
"/home/58626/data/python/lib/django/core/management/base.py", line 210, in
execute translation.activate('en-us') File
"/home/58626/data/python/lib/django/utils/translation/__init__.py", line
73, in activate return real_activate(language) File
"/home/58626/data/python/lib/django/utils/translation/__init__.py", line
43, in delayed_loader return g['real_%s' % caller](*args, **kwargs) File
"/home/58626/data/python/lib/django/utils/translation/trans_real.py", line
209, in activate _active[currentThread()] = translation(language) File
"/home/58626/data/python/lib/django/utils/translation/trans_real.py", line
198, in translation default_translation = _fetch(settings.LANGUAGE_CODE)
File "/home/58626/data/python/lib/django/utils/translation/trans_real.py",
line 181, in _fetch app = getattr(__import__(appname[:p], {}, {},
[appname[p+1:]]), appname[p+1:]) AttributeError: 'module' object has no
attribute 'web'

第一个应用的名称是“web”。

1 个答案:

答案 0 :(得分:3)

我将采取的步骤

  1. 在媒体模板实例上运行开发服务器。如果运行成功,那么你的apache / nginx / whaever设置显然是错误的。
  2. 我没有运行应用程序作为FCGI的经验,它看起来像你正在尝试做的。它看起来在某种程度上当Fcgi运行时,它无法找到你的应用程序。所以这可能是一个PYTHONPATH问题。从fcgi脚本中记录/打印sys.path并查看。