Django: Site-Wide URL Prefix

Posted by Tom on Stack Overflow See other posts from Stack Overflow or by Tom
Published on 2010-05-24T15:47:28Z Indexed on 2010/05/24 15:51 UTC
Read the original article Hit count: 182

Filed under:
|

I've built a Django site that will live at the root when it's live. Right now it's functioning perfectly at the IP address. For testing purposes, the client has pointed a proxy url at it, but the url has /folder/path in it, so none of the URL patterns match. I put (/folder/path)? into all the url patterns so they now respond, but all of the links are broken because I'm using the {% url %} tag and while the url patterns will match the optional path, they don't include it in that tag.

Clearly I can just hard-code /folder/path into all of my urls (well, into all of the url includes) until testing is complete, but is there a better way to do this?

© Stack Overflow or respective owner

Related posts about django

Related posts about django-urls