I’ve been developing in my own django environment for a while now using the manage.py runserver with no problems, but now that we’ve got a designer and a front-end developer needing to work on the project, I find myself at a loss as to what is the Best Practise for their environments.
I could ask them to setup their own python environment, but that’s asking an awful lot since they’re not Python people and they’re running Windows (my dev and the production environment are both Linux).
So instead, I’ve set them up on a remote server, the disk of which they can mount locally. However in this setup, I’m actually using different instances of manage.py runserver ip:port running in a screen instance. It doesn’t handle things like constant reloads very well (common for our designer) and it hangs from time to time due to the single-threaded nature of the dev server. I’d like to know how to set this up with Apache.
The problem with this of course is the staticfiles. Every time either of the aforementioned parties want to add or change a static file, they’d have to run manage.py collectstatic which just isn’t practical. I just don’t know any other way to do it though. All of the documentation I’ve found for using Apache is for a production environment, so… that’s why I’m here.
The answer to this one was a lot simpler than I thought it would be and I apologise for confusing those who responded. Basically all I wanted was a way to host our designer’s dev environment in something more stable than
./manage.py runserver ip:portin ascreensession. I figured that there had to be a way to set something like this up for Apache but had no idea what it was.Here’s what I got to work:
In your
settings.pyset yourSTATIC_URLandMEDIA_URLvariables to relative URLs. In my case I used/static/and/media/.Configure Apache as you would if you didn’t have any static files at all. In other words, ignore the recommendations of the docs to use
SetHandler Nonein a<Locaiton>block.staticfilesthrough Python at https://docs.djangoproject.com/en/1.3/howto/static-files/#serving-other-directoriesI hope this helps to point someone in the right direction in the future.