重新加载 mod_fcgid 而不终止 Python 服务
我目前正在学校的网络服务器上使用 FCGI 运行 Django 项目。我确实遵循了多个建议安装虚拟本地 Python 环境的指南,结果非常好。我遇到的唯一问题是“触摸”我的 fcgi 文件来重新加载源文件是不够的,但我必须通过 SSH 终止 python 服务。这是因为使用了 mod_fcgid。
然而,管理员认为我运行自己的本地 python 并不是一个好主意。他认为如果我只是告诉他要在 root 上安装哪些模块会更好,这确实是一项非常好的服务。
但是这样做,我不能再杀死Python,因为它在根目录下(虽然我很不道德,但我确实尝试过)。管理员的建议是我也应该尝试通过检查时间戳来重新加载 fcgi 脚本。我试图找到有关如何做到这一点的文档,但资金很少,而且由于我是一个绝对的初学者,我不知道什么会起作用。 有人有在 mod_fcgid 下运行 python/django 的经验吗?或者有关于在哪里可以找到相关指南/文档的提示?
I'm currently running a Django project on my school's webserver with FCGI. I did follow the multiple guides that recommends installing a virtual local Python environment and it worked out great. The only issue i had was that "touching" my fcgi-file to reload source-files wasn't enough, but instead i had to kill the python service via SSH. This because mod_fcgid is used.
However, the admin didn't think it was a great idea that i ran my own local python. He thought it better if i just told him what modules to install on root, which was a pretty nice service really.
But doing this, i can no longer kill python since it's under root(though immoral as I am, I've definitely tried). The admins recommendation was that I should try too make the fcgi script reload itself by checking time stamp. I've tried to find documentation on how to do this, but fund very little and since I'm a absolute beginner i have no idea what would work.
Anyone have experience running python/django under mod_fcgid or tips on where to find related guides/documentation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这就是我要做的:
当然这不是完美的(您可能不得不弄乱线程),但它应该让您了解如何完全“重新加载”模块。
here's what I would do:
granted this isn't drop-in perfect (you might have to mess w/ the threading) but it should give you a general idea of how to "reload" a module completely.