I am developing a Django app on Mac OS 10.8. The production server is an Ubuntu server. On the production server, I created symlinks to the directory below:
(On Ubuntu)
/var/virtualenvs/some_virtualenv/lib/python2.6/site-packages/django/contrib/admin/media
But those symlinks obviously don’t work in my local OS X dev environment:
(On OS X)
/Users/username/Webdev/.virtualenvs/some_virtualenv/lib/python2.7/site-packages/django/contrib/admin/media
The symlink apparently made it into the git repo. Django deployment really is a bit of a pain! Can someone tell me how to deal with deployment in two different environments?
UPDATE: Is it simply a matter of making sure the symlinks are excluded from the git?
Django deployment really isn’t too hard, but there are a couple of patterns that are useful. The first, is to split out your production and development settings. There are a number of different ways to do this, most of which are described in the django documentation.
Also, if you’re using Django >= 1.4, you don’t need to symlink to admin media anymore since it has been converted to using staticfiles.
I use this template when creating any new django 1.4 projects, which includes generating your production and local settings.
Symlinks shouldn’t be included in your git repo IMO. There are better ways of managing how to access your media.