move the django admin media files from _generated_media/1/admin to some directory inside the PROJECT_DIR:
1. move the admin dir to desired location, say PROJECT_DIR/admin_media
2. modify app.yaml urls to point to that static_dir location, e.g. add
- url: /admin_media
static_dir: admin_media
3. modify the MEDIA_URL and ADMIN_MEDIA_PREFIX in settings.py
MEDIA_URL = “/media/”
ADMIN_MEDIA_PREFIX = “/admin_media/”
We need to override MEDIA_URL so that when we access the media_url path from the templates, we don’t get the altered media_url (settings_post.py alters this by appending the MEDIA_VERSION by interpolating the %s. ADMIN_MEDIA_PREFIX is also based on the MEDIA_URL, but we want it to use /admin_media.
Comments 0 Comments