如何修改sys.path中的的.htaccess允许的mod_python看Django的? [英] How do I modify sys.path from .htaccess to allow mod_python to see Django?

查看:121
本文介绍了如何修改sys.path中的的.htaccess允许的mod_python看Django的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑主办一个Django站点的主机有mod_python的安装,但没有Django的。 Django的INSTALL文件表明,我可以Django的目录简单地复制到Python的site-packages目录来安装Django,所以我怀疑它可能是可以配置的Python / mod_python的修改SYS寻找它在其他地方(即我的用户空间)。道路,但是我不知道如何将它从的.htaccess或mod_python的改变。

The host I'm considering for hosting a Django site has mod_python installed, but does not have Django. Django's INSTALL file indicates that I can simply copy the django directory to Python's site-packages directory to install Django, so I suspect that it might be possible to configure Python / mod_python to look for it elsewhere (namely my user space) by modifying sys.path, but I don't know how to change it from .htaccess or mod_python.

如何修改的sys.path 的.htaccess 允许的mod_python看Django的?

How do I modify sys.path from .htaccess to allow mod_python to see Django?

P.S。我只能访问通过FTP站点(即没有shell访问)。我知道这听起​​来像我应该切换主机,但有令人信服的理由让我做这个工作,所以我至少要去尝试。

P.S. I can only access the site via FTP (i.e. no shell access). I realize that it sounds like I should just switch hosts, but there are compelling reasons for me to make this work so I'm at least going to try.

推荐答案

根据票#2255 Django的,你需要管理员访问的httpd.conf,以使用Django与m​​od_python的,这是不会改变的,所以你可能会死在水里。要回答如何修改的sys.path 的.htaccess 基本的问题,你可以使用的 PYTHONPATH 指令在的.htaccess

According to ticket #2255 for Django, you need admin access to httpd.conf in order to use Django with mod_python, and this is not going to change, so you may be dead in the water. To answer the basic question of how to modify sys.path from .htaccess, you can use the PythonPath directive in .htaccess.

这篇关于如何修改sys.path中的的.htaccess允许的mod_python看Django的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆