I don't think you need re.sub here (you can just slice the string), but I don't feel strongly about making this change.  Others might though.

Actually, I don't see the subbing out of "/static" from the surrounding code.  is it really necessary?