I am using request.path to return the current URL in Django, and it is returning /get/category.
request.path
/get/category
I need it as get/category (witho
get/category
Another one with regular expressions:
>>> import re >>> s = "/get/category" >>> re.sub("^/|/$", "", s) 'get/category'