Django: Don't let MEDIA_URL and ADMIN_MEDIA_PREFIX conflict
I'm working on a Django app and was getting an odd result when I tried to access the URL of an image referenced in an ImageField. The image uploaded successfully but I couldn't access it from the browser even after adding the proper URL confs to access static media. When I accessed the URL from get_FIELD_url the browser returned:
Page not found: /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/contrib/admin/...
It turns out I had decided to make my media accessible via a /media/ URL, which is also the default for ADMIN_MEDIA_PREFIX. The ADMIN_MEDIA_PREFIX setting is not a URL, so it's not obvious it was in conflict.
So don't put your media in your sites /media/ URL, or if you do change ADMIN_MEDIA_PREFIX.
Thanks to tonyskyday on #djangoIRC for help with this!