django - 导入错误 : No module named modpython

标签 django apache2 mod-python

我正在尝试在我的虚拟主机上设置 django,但遇到了这个错误:

MOD_PYTHON ERROR

ProcessId:      4496
Interpreter:    'ouiop'

ServerName:     'ouiop.com'
DocumentRoot:   '/var/www/vhosts/ouiop.com/httpdocs'

URI:            '/'
Location:       '/'
Directory:      None
Filename:       '/var/www/vhosts/ouiop.com/httpdocs/'
PathInfo:       ''

Phase:          'PythonHandler'
Handler:        'django.core.handlers.modpython'

Traceback (most recent call last):

  File "/usr/lib/python2.7/dist-packages/mod_python/importer.py", line 1537, in HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)

  File "/usr/lib/python2.7/dist-packages/mod_python/importer.py", line 1202, in _process_target
    module = import_module(module_name, path=path)

  File "/usr/lib/python2.7/dist-packages/mod_python/importer.py", line 304, in import_module
    return __import__(module_name, {}, {}, ['*'])

ImportError: No module named modpython

我在网上做了一些研究,看看是否有人遇到同样的问题,但没有运气解决:/

这也是我的 vhosts.conf

<Location "/">
SetHandler python-program
PythonPath "['/var/www/vhosts/ouiop.com/httpdocs/django_projects'] + sys.path"
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE ouiop.settings
PythonDebug On
PythonInterpreter ouiop
</Location>

<Location "/media">
SetHandler None
</Location>

<LocationMatch "\.(jpg|gif|png)$">
SetHandler None
</LocationMatch>

感谢任何帮助

谢谢

最佳答案

您可能正在使用已停止支持 mod_python 的 Django 1.5

要切换到 wsgi,请参阅 http://library.linode.com/frameworks/django-apache-mod-wsgi/ubuntu-10.04-lucid

关于django - 导入错误 : No module named modpython,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11466949/

相关文章:

python - Mod_python 不产生输出

python - 在 Windows 上使用 Python 2.6 的 mod_python

Django:如何从模板中识别调用 View ?

django - 刷新单个应用程序 django 1.9

python - "TypeError: Input ' global_step ' of ' ResourceApplyAdagradDA ' Op has type int32 that does not match expected type of int64."这是什么错误?

php - 重定向而不更改浏览器 url

python - 通过 AJAX 将 Python 数组发送到 django 模板

Angular Service Worker SwUpdate.available 未触发

apache - 在 apache http 服务器上设置 mod_proxy

python - 使用 Apache + mod_wsgi 的 Web 内容过滤器?