Home  >  Q&A  >  body text

python - django项目部署再apache中调试问题

django项目部署再apache中,因为是测试服务器,所以经常会有修改,但部署再apache中会有缓存,经常要重启下apache才能看到修改后的效果。能不能做什么配置,让项目像再django的自带的服务器上一样,修改后马上就能看到效果? 谢谢各位指教。

黄舟黄舟2721 days ago394

reply all(2)I'll reply

  • 巴扎黑

    巴扎黑2017-04-17 13:22:47

    I tell you clearly no!

    This is not the apache cache. After updating the code, the new code must be restarted before it can run.
    Since it is a test server, you might as well run Django directly without apache. In fact, after such modification in Django debug mode, you will immediately see the effect and restart it.
    Of course, you can also write a shell to automatically restart apache when the file is updated. Gaga

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 13:22:47

    Do not modify Apache in the test environment. Just run Django in HTTP mode and it will be ok.

    reply
    0
  • Cancelreply