[Answered ]-Development setup advice needed – Django + Apache2 + mod_wsgi – on Mac and Ubuntu Dev Server

1👍

Sounds OK to me.

Multiple code instances. So that if Ubuntu crashes, I have the code on Mac

If you want to be extra paranoid (like I am) you should think of a third place where your code is available. A git solution like github plus something like Dropbox might be worth pondering.

1👍

If your using Django, why bother installing Apache. Django comes with an
excellent dev environment. I just use: manage.py runserver

You achieve your 2 points, by just having git clones on the server and on your
laptop for work. No need for Apache.

Two notes:

  1. Since I ran into a bug that occurred on MySQL, but didn’t on sqlite, I test
    projects on the same dbbackend before deploying. But for development on the
    laptop, all I need is Python, Django and sqlite.

  2. I try to use the same Python as on the deployment server. I’ve deployed on
    “Enterprise” distro’s which means ancient (“stable”) versions, that miss new
    features. virtualenv helps keeping things seperated.

These two can be solved by just adding an extra ‘test’ deployment of your
project on the server for a last testrun on the same platform just before your
updates.

PS: If you don’t mind installing and configuring the extra software why not go all out and install an Ubuntu VM in a virtualbox. You could even make your main server a VM and every now and then take a snapshot of the image on the road…

edit: runserver will listen on port 8000 on localhost. If you want to connect to it from other hosts use manage.py runserver 0.0.0.0:8000 to listen on 8000 on all ip-addresser or, if you’re worried on leaking info to snoopers, use ssh -L8000:127.0.0.1:8000 <ubuntu-server> to tunnel 8000 on localhost (your client) to 8000 on localhost (your server) through ssh. Whichever fits your needs.

Leave a comment