小编Dan*_*Dan的帖子

如何停止获取ImportError:在将django与wsgi一起使用时无法导入设置'mofin.settings'?

我无法让wsgi为我的项目'mofin'导入我的设置文件.

apache错误日志中的错误列表如下所示

mod_wsgi (pid=4001): Exception occurred within WSGI script '/var/www/wsgi-scripts/django.wsgi'.
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/django/core/handlers/wsgi.py", line 228, in __call__
    self.load_middleware()
  File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py", line 31, in load_middleware
    for middleware_path in settings.MIDDLEWARE_CLASSES:
  File "/usr/lib/python2.5/site-packages/django/conf/__init__.py", line 28, in __getattr__
    self._import_settings()
  File "/usr/lib/python2.5/site-packages/django/conf/__init__.py", line 59, in _import_settings
    self._target = Settings(settings_module)
  File "/usr/lib/python2.5/site-packages/django/conf/__init__.py", line 94, in __init__
    raise ImportError, "Could not import settings '%s' (Is it on sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE, e)
ImportError: Could not import settings 'mofin.settings' …
Run Code Online (Sandbox Code Playgroud)

python apache django wsgi

63
推荐指数
7
解决办法
8万
查看次数

fabric似乎启动了apache2,但没有

我正在使用fabric远程启动微型aws服务器,安装git和git存储库,调整apache配置然后重启服务器.

如果在任何时候,我发布fabfile文件

sudo('service apache2 restart')或者run('sudo service apache2 restart')一个停止然后一个开始,该命令显然运行,我得到响应表明apache已经启动,例如

[ec2-184-73-1-113.compute-1.amazonaws.com] sudo: service apache2 start
[ec2-184-73-1-113.compute-1.amazonaws.com] out:  * Starting web server apache2
[ec2-184-73-1-113.compute-1.amazonaws.com] out:    ...done.
[ec2-184-73-1-113.compute-1.amazonaws.com] out: 
Run Code Online (Sandbox Code Playgroud)

但是,如果我尝试连接,则拒绝连接,如果我ssh进入服务器并运行 sudo service apache2 status它说" Apache is NOT running"

如果sshed,如果运行 sudo service apache start,服务器启动,我可以连接.还有其他人经历过这个吗?或者是否有人有任何关于我可以在哪里看的提示,在日志文件等中找出已发生的事情.什么都没有apache2/error.log,syslog或者auth.log.

这不是什么大不了的事,我可以解决它.我只是不喜欢这种无声的失败.

ssh python-2.6 apache2.2 fabric ubuntu-10.04

24
推荐指数
2
解决办法
6084
查看次数

标签 统计

apache ×1

apache2.2 ×1

django ×1

fabric ×1

python ×1

python-2.6 ×1

ssh ×1

ubuntu-10.04 ×1

wsgi ×1