Django Journal- Apache on Mac OS X does not recognize Aliases!

This one isn’t really django -related, but when doing local development work with django you may have to do some fancy folder aliasing to get your image-uploads working, for example.

Since Apache can’t read an OS X alias file, the solution is to create a symlink.

For some reason I’ve always found symlinks to be a bit tricky. I think they’re kind of finicky, needing to be just so in order to work.

  1. Open Terminal.
  2. cd into the directory where you want to create the alias.
  3. ln -s /Users/USERNAME/dir/to/link/to/ aliasDir

    It’s important that the first argument be an absolute path (i.e., don’t use “~”) and that it have a trailing “/” on the end. HOWEVER, make sure that “aliasDir” doesn’t have a trailing “/”.

  4. Good to go!
  5. Learn UNIX with the excellent Sams series: Sam’s Teach Yourself UNIX in 24 hours

Leave a Reply

Your email address will not be published. Required fields are marked *

This blog is kept spam free by WP-SpamFree.

Get Adobe Flash player