如何从.htaccess修改sys.path以允许mod_python看到Django? [英] How do I modify sys.path from .htaccess to allow mod_python to see Django?
问题描述
如何修改 sys.path
从 .htaccess
允许mod_python看到Django?
PS我只能通过FTP访问网站(即没有shell访问)。我知道这听起来像是我应该切换主机,但是有一些引人注目的理由让我做这个工作,所以我至少要去尝试。
根据Django的 ticket#2255 ,您需要管理员访问权限到httpd.conf以使用Django与mod_python,这不会改变,所以你可能在水中死亡。要解决如何从 .htaccess
修改 sys.path
的基本问题,可以使用 PythonPath 指令在 .htaccess
。
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.
How do I modify sys.path
from .htaccess
to allow mod_python to see Django?
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.
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
.
这篇关于如何从.htaccess修改sys.path以允许mod_python看到Django?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!