简体   繁体   中英

Have to Restart Apache When Using Django On Apache with mod_wsgi

I'm creating a web app with Django. Since I'm very familiar with Apache I setup my development environment to have Django run through Apache using mod_wsgi. The only annoyance I have with this is that I have to restart Apache everytime I change my code. Is there a way around this?

mod_wsgi is great for production but I think the included server is better for development.

Anyway you should read this about automatic reloading of source code.

I feel like this is really just one of those things most people deal with. It's really not that big of a deal. I made a bash script to make this as easy as possible. I name it 'ra' (reload apache) so it's short and quick. The following works for most apache installs (on UNIX-based systems):

#!/bin/bash
sudo /etc/init.d/apache2 reload

You could probably use some kind of tool to bind this to a key shortcut/foot pedeal/cron.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM