from django.urls import path
from .views import {% for k,_ in names.items() %}{% if loop.last %}{{ k }}List, {{ k }}Detail{% else %}{{ k }}List, {{ k }}Detail,{% endif %}{% endfor %}

urlpatterns = [
    {% for k,v in names.items() %}
    path("/{{ v }}", {{ k }}List.as_view(), name="{{ v }}s"),
    path("/{{ v }}/<int:pk>", {{ k }}Detail.as_view(), name="{{ v }}"),
    {% endfor %}
]
