I would like to match URL string “anything#1” in django. My regular expression goes like this:
r'^(?P<title>\w+[_]*)?/#(?P<id>\d+)/$'
The “#1” part should be optional, so I put question mark there. However it shows me an error. What am I doing bad?
Django doesn’t control signet (or fragment), you can get it in your view with
HttpRequest.get_full_path():Get it only with :