Access MEDIA_URL from static Javascript files in Django
This is an old trick, that’s been very handy .
Many times for various reasons you’ll need to access your media files from your Javascript files, to display images, change paths, or whatever. And in most cases your development MEDIA_URL and production MEDIA_URL will be different, so having to change them depending on the enviroment [...]
Comments(2)