id summary reporter owner description type status component version severity resolution keywords cc stage has_patch needs_docs needs_tests needs_better_patch easy ui_ux 25598 Add support for SCRIPT_NAME in STATIC_URL and MEDIA_URL Dheerendra Rathor Oleg Kainov "By default, `{% static '...' %}` tag just appends `STATIC_URL` in the path. When running on sub-path, using `SCRIPT_NAME` WSGI param, it results in incorrect static URL - it doesn't prepend `SCRIPT_NAME` prefix. This problem can be solved with prepending `SCRIPT_NAME` to `STATIC_URL` in `settings.py` but that doesn't work when `SCRIPT_NAME` is a ''dynamic value''. This can be easily added into default Django `static` tag and `django.contrib.staticfiles` tag as following: {{{ def render(self, context): url = self.url(context) # Updating url here with request.META['SCRIPT_NAME'] if self.varname is None: return url context[self.varname] = url return '' }}} On more research I found that `FileSystemStorage` and `StaticFilesStorage` ignores `SCRIPT_NAME` as well. We might have to do a lot of changes but I think it's worth the efforts. " New feature closed contrib.staticfiles dev Normal fixed script_name, static_url, media_url kottenator@… Ready for checkin 1 0 0 0 0 0