from django.urls import path
from django.conf.urls import include
from rest_framework import routers
from {{ app_name }} import {{ views_file }}

router = routers.DefaultRouter()

# {{ app_name }} API Endpoints
{% for model in model_list -%}
router.register(r'{{ model._meta.model_name }}', {{views_file}}.{{ model.__name__ }}ViewSet, "{{ model._meta.model_name}}")
{% endfor %}

urlpatterns = [

    # API views
    path('{{app_name}}/', include(router.urls, namespace='{{app_name}}')),

]

