gpt4 book ai didi

python - 在 mod_wsgi 上部署 django 应用程序时出现问题

转载 作者:行者123 更新时间:2023-12-01 06:12:15 24 4
gpt4 key购买 nike

我在使用 mod_wsgi 部署 django 时似乎遇到问题。过去我使用过 mod_python 但我想做出改变。我一直在使用 Graham Dumpleton 笔记 http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango 1 ,但似乎还是不行。我收到内部服务器错误。

django.wsgi file:

import os
import sys

sys.path.append('/var/www/html')
sys.path.append('/var/www/html/c2duo_crm')

os.environ['DJANGO_SETTINGS_MODULE'] = 'c2duo_crm.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

WSGIScriptAlias / /var/www/html/c2duo_crm/apache/django.wsgi

Apache httpd file:

<Directory /var/www/html/c2duo_crm/apache>
Order allow,deny
Allow from all
</Directory>

在我的 apache 错误日志中,它说我有这个错误这不是全部,但我有最重要的部分:

[Errno 13] Permission denied: '/.python-eggs'
[Thu Mar 03 14:59:25 2011] [error] [client 127.0.0.1]
[Thu Mar 03 14:59:25 2011] [error] [client 127.0.0.1] The Python egg cache directory is currently set to:
[Thu Mar 03 14:59:25 2011] [error] [client 127.0.0.1]
[Thu Mar 03 14:59:25 2011] [error] [client 127.0.0.1] /.python-eggs
[Thu Mar 03 14:59:25 2011] [error] [client 127.0.0.1]
[Thu Mar 03 14:59:25 2011] [error] [client 127.0.0.1] Perhaps your account does not have write access to this directory? You can
[Thu Mar 03 14:59:25 2011] [error] [client 127.0.0.1] change the cache directory by setting the PYTHON_EGG_CACHE environment
[Thu Mar 03 14:59:25 2011] [error] [client 127.0.0.1] variable to point to an accessible directory.

最佳答案

Python Egg s 是 zip 文件中包含的模块文件。 Python Egg Cache 是 Python 提取它们以便运行它们的目录。目前,您正在尝试将它们提取到/.python-eggs,但您没有该目录的写入权限,或者/如果它不存在的话。

您有两个选择,您可以创建/.python-eggs 并使其全局可写(或者至少可由运行 Apache 的用户写入),或者您可以将 PYTHON_EGG_CACHE (使用 WSGIPythonEggs directive )设置为您有写入权限的目录。

关于python - 在 mod_wsgi 上部署 django 应用程序时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5182954/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com