配置错误:导入中间件indivo时出错_server.indivo.Middleware.authentication:“无法导入名称HttpRequests

2024-05-11 03:22:41 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在ubuntu14.10上用indivoheath构建概念证明。我用Mysql安装了服务器和用户界面。在

http://indivo.smartrx.in:8002——UI服务器url

http://indivo.smartrx.in:8001——Indivo服务器url[这显示了内部服务器错误,下面给出了日志]

 [Mon Jan 18 12:48:23.888096 2016] [:error] [pid 28663] [client IP:39138] mod_wsgi (pid=28663): Exception occurred processing WSGI script '/var/www/html/sample/indivo_server/django.wsgi'.
    [Mon Jan 18 12:48:23.888199 2016] [:error] [pid 28663] [client IP:39138] Traceback (most recent call last):
    [Mon Jan 18 12:48:23.888253 2016] [:error] [pid 28663] [client IP:39138]   File "/var/www/html/sample/indivo_server/django.wsgi", line 40, in __call__
    [Mon Jan 18 12:48:23.888399 2016] [:error] [pid 28663] [client IP:39138]     return self.application(environ, _start_response)
    [Mon Jan 18 12:48:23.888435 2016] [:error] [pid 28663] [client IP:39138]   File "/var/www/html/sample/indivo_env/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 219, in __call__
    [Mon Jan 18 12:48:23.888631 2016] [:error] [pid 28663] [client IP:39138]     self.load_middleware()
    [Mon Jan 18 12:48:23.888673 2016] [:error] [pid 28663] [client IP:39138]   File "/var/www/html/sample/indivo_env/lib/python2.7/site-packages/django/core/handlers/base.py", line 47, in load_middleware
    [Mon Jan 18 12:48:23.888950 2016] [:error] [pid 28663] [client IP:39138]     raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e))
    [Mon Jan 18 12:48:23.888998 2016] [:error] [pid 28663] [client IP:39138] ImproperlyConfigured: Error importing middleware indivo_server.indivo.middlewares.authentication: "cannot import name HTTPRequest"


Indivo_server - settings.py ->> 

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'indivo_server.indivo.middlewares.authentication.Authentication',
    'indivo_server.indivo.middlewares.paramloader.ParamLoader',
    'indivo_server.indivo.middlewares.authorization.Authorization',
    'indivo_server.indivo.middlewares.audit.AuditWrapper'
)

我有一个indivo文件夹,即/var/www/html/sample/indivo_server/indivo,其中包含所有中间件和其他文件夹。在

我要解决的问题:

  1. 无法使用登录UI服务器johnsmith@example.org/J史密斯/密码。示例在
  2. Indivo服务器问题

我已经花了3天多的时间来设置和一天在这个问题上请帮助我解决这些。在

非常感谢你的帮助。在


Tags: sampledjangoinip服务器clientservervar
1条回答
网友
1楼 · 发布于 2024-05-11 03:22:41

我的系统路径也有系统范围的python路径,所以我删除了那些路径,只保留virtualenv路径。之后,我在.pth文件中添加了模块路径,并保存在“site packages”环境文件夹下。问题解决了。:-)

相关问题 更多 >