Django 服务器上的 UserDir
我有一个使用 mod_python 和 Apache 运行的 django 网站。当前配置将所有 / 流量定向到 django 站点。现在,我还需要在计算机上启用 userDir /~user 。我已经在 Apache 中启用了 userDir 模块。由于 Apache 将所有请求重定向到 django 应用程序,因此 /~user 无法工作,因为 django 只是脱口而出 404。我知道发生这种情况是由于以下原因
<Location "/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE web.settings
PythonOption django.root
PythonDebug off
PythonPath "['/path/to/the/django/source/'] + sys.path"
</Location>
我需要做什么来提供网页服务/ 并还从 /~user 提供 userDir 服务? (我认为这与正则表达式和 LocationMatch Apache 指令有关。我对正则表达式不够好,无法做我想做的事情)。任何帮助将不胜感激。
I have a django website running with mod_python and Apache. The current configuration directs all / traffic to the django site. Now, I need to enable userDir /~user on the machine as well. I have enabled the userDir module in Apache. Since, Apache is redirecting all the request to the django app, /~user is not working as the django just blurts out a 404. I understand that this is happening due to the following reason
<Location "/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE web.settings
PythonOption django.root
PythonDebug off
PythonPath "['/path/to/the/django/source/'] + sys.path"
</Location>
What would I have to do to serve the webpage from / and also serve userDir from /~user ? (I think it has to do with regex and LocationMatch Apache directive. I am not good enough with regex to do what I want). Any help will be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)