Remove leading and trailing slash / in python
you can try:
"/get/category".strip("/")
I am using request.path  to return the current URL in Django, and it is returning  /get/category.
I need it as get/category (without leading and trailing slash). 
How can I do this?