I am trying to serve static files from another domain (sub domain of current domain).
To serve all media files I used this settings:
MEDIA_URL =
‘http://media.bud-inform.co.ua/‘
So when in template I used
{{ MEDIA_URL }}
it was replace with the setting above. Now I am trying to serve admin media files from the same subdomain, I changed the settings this way:
ADMIN_MEDIA_PREFIX =
‘http://media.bud-inform.co.ua/admin_media/‘,
and expected that all calls to media from my admin site will be made to this url…. But actually it didn’t work this way, I still see paths to CSS made as following:
Could you suggest how to serve admin media files correctly
MEDIA_URLandADMIN_MEDIA_PREFIXare two different things. One is the location of your media files, while the other is the location of the django admin system’s media files.You have to make sure that the
ADMIN_MEDIA_PREFIXpoints to somewhere where you’re actually serving the admin media. Django doesn’t handle that step for you.The django admin media is at
django/contrib/admin/media/. Copy or symlink that directory somewhere publicly visible and setADMIN_MEDIA_PREFIXto reflect where you put it.