Django的+ WSGI:清爽的问题? [英] Django + WSGI: Refreshing Issues?

查看:96
本文介绍了Django的+ WSGI:清爽的问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个Django站点。我正在做我的现场服务器上的所有变化,只是因为它更容易的方式。问题是,每一个现在,然后它似乎想缓存我工作的* .py文件之一。有时候,如果我打刷新了很多,它会来回切换一个旧版本的页面,而较新的版本之间。

I'm developing a Django site. I'm making all my changes on the live server, just because it's easier that way. The problem is, every now and then it seems to like to cache one of the *.py files I'm working on. Sometimes if I hit refresh a lot, it will switch back and forth between an older version of the page, and a newer version.

我的设立是多还是少像什么在Django的教程描述:<一href=\"http://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/#howto-deployment-modwsgi\">http://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/#howto-deployment-modwsgi

My set up is more or less like what's described in the Django tutorials: http://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/#howto-deployment-modwsgi

我的猜测的它这样做,因为它发射了的WSGI处理程序的多个实例,并根据其处理程序HTTP请求被发送到,我可能会收到不同的版本页面。重启动Apache似乎解决了问题,但是这很烦人。

I'm guessing it's doing this because it's firing up multiple instances of of the WSGI handler, and depending on which handler the the http request gets sent to, I may receive different versions of the page. Restarting apache seems to fix the problem, but it's annoying.

我真的不知道很多关于WSGI或中间件或者类似的请求处理的东西。我来自一个PHP的背景下,在这一切只是工作:)

I really don't know much about WSGI or "MiddleWare" or any of that request handling stuff. I come from a PHP background, where it all just works :)

总之,什么是解决这一问题的一个很好的方式?将运行WSGI处理程序是守护模式缓解这一问题?如果是这样,我怎么得到它以守护进程模式下运行?

Anyway, what's a nice way of resolving this issue? Will running the WSGI handler is "daemon mode" alleviate the problem? If so, how do I get it to run in daemon mode?

推荐答案

您可以通过不编辑code中的活的服务器上解决此问题。说真的,没有借口了。使用版本控制在当地发展,如果你一定要,从现场结账运行服务器,用post-commit钩子,检查出你的最新版本,并重新启动Apache的。

You can resolve this problem by not editing your code on the live server. Seriously, there's no excuse for it. Develop locally using version control, and if you must, run your server from a live checkout, with a post-commit hook that checks out your latest version and restarts Apache.

这篇关于Django的+ WSGI:清爽的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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