Make trailing slash optional in Django
Python, Django
python
# In your urls.py
class OptionalSlashRouter(SimpleRouter):
def __init__(self):
self.trailing_slash = "/?"
super(SimpleRouter, self).__init__()
router = OptionalSlashRouter()
python
# In your urls.py
class OptionalSlashRouter(SimpleRouter):
def __init__(self):
self.trailing_slash = "/?"
super(SimpleRouter, self).__init__()
router = OptionalSlashRouter()