带有Apache的Django-双内容响应
我使用apache运行django实例。 我的apache将django输出加倍 因此,在开发过程中,我得到了以下结论:带有Apache的Django-双内容响应,django,apache,response,virtualhost,Django,Apache,Response,Virtualhost,我使用apache运行django实例。 我的apache将django输出加倍 因此,在开发过程中,我得到了以下结论: my response text 但在apache“生产”上,这是: 我的vhost配置如下所示: <VirtualHost *> Alias /public /xxx
my response text
但在apache“生产”上,这是:
我的vhost配置如下所示:
<VirtualHost *>
Alias /public /xxx/public
Redirect /robots.txt /public/robots.txt
<Directory "/xxx">
Order allow,deny
Allow from all
</Directory>
ServerName www.xxx.de
ServerAlias *.xxx.de
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE settings
SetEnv PYTHON_EGG_CACHE '/tmp/python-eggs'
PythonHandler django.core.handlers.modpython
PythonDebug Off
PythonPath "['', '/xxx'] + sys.pa
</VirtualHost>
别名/public/xxx/public
重定向/robots.txt/public/robots.txt
命令允许,拒绝
通融
服务器名www.xxx.de
服务器别名*.xxx.de
SetHandler python程序
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_设置_模块设置
SetEnv PYTHON_EGG_缓存'/tmp/PYTHON eggs'
PythonHandler django.core.handlers.modpython
蟒蛇关
PythonPath“[”,/xxx']+sys.pa
我不知道出了什么问题,你知道吗?我不知道这是否是问题所在,但你已经让PythonHandler写了两次了。
而且,许多人更喜欢使用mod_python。有趣的是,它起到了作用。似乎PythonHandler被评估了两次。
<VirtualHost *>
Alias /public /xxx/public
Redirect /robots.txt /public/robots.txt
<Directory "/xxx">
Order allow,deny
Allow from all
</Directory>
ServerName www.xxx.de
ServerAlias *.xxx.de
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE settings
SetEnv PYTHON_EGG_CACHE '/tmp/python-eggs'
PythonHandler django.core.handlers.modpython
PythonDebug Off
PythonPath "['', '/xxx'] + sys.pa
</VirtualHost>