Search code examples
djangodjango-urlssymbolsdollar-sign

Django: dollar symbol in urls.py


Wondering if it is possible to catch dollar symbol in urls.py. Url is called as "/blabla/bla/$something" and I'm having hard time trying to catch this url, as "$" is being interpreted as end of line. Can someone please assist.

Thanks.


Solution

  • The standard way of escaping special characters in regular expressions is to prefix them with "\".

    So try something like this:

    url('^/blabla/bla/\$omething/$', …)