Make trailing slash optional in Django

Python, Django

Make trailing space optional in Django by overriding `SimpleRouter` in your `urls.py`

python

# In your urls.py class OptionalSlashRouter(SimpleRouter): def __init__(self): self.trailing_slash = "/?" super(SimpleRouter, self).__init__() router = OptionalSlashRouter()