Django is able to transparently run under a sub-path of a domain (e.g. http://example.com/mydjangoproject/) as long as the environment variable SCRIPT_NAME is properly set.
dj_static currently is broken in this setup (if STATIC_URL is set correctly for the staticfiles app to work, it never handles the requests as the paths mismatch).
This patch makes dj_static compatible to SCRIPT_NAME using the same transformations as the Django source code.
Django is able to transparently run under a sub-path of a domain (e.g.
http://example.com/mydjangoproject/
) as long as the environment variableSCRIPT_NAME
is properly set.dj_static currently is broken in this setup (if
STATIC_URL
is set correctly for thestaticfiles
app to work, it never handles the requests as the paths mismatch).This patch makes dj_static compatible to
SCRIPT_NAME
using the same transformations as the Django source code.