Beispiel #1
0
from django.contrib import admin
from django.urls import path, include
from escola.urls import router_urls
from escola.views import ListaMatriculasAluno, ListaAlunosMatriculados

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include(router_urls)),
    path('lista/matriculas/aluno/<int:pk>/', ListaMatriculasAluno.as_view()),
    path('lista/matriculas/curso/<int:pk>/',
         ListaAlunosMatriculados.as_view()),
]
Beispiel #2
0
from django.contrib import admin
from django.urls import path, include
from escola.views import AlunosViewSet, CursosViewSet, MatriculaViewSet, ListaMatriculasAluno, ListaAlunosMatriculados
from rest_framework import routers
from django.conf import settings
from django.conf.urls.static import static

router = routers.DefaultRouter()
router.register('alunos', AlunosViewSet, basename='Alunos')
router.register('cursos', CursosViewSet, basename='Cursos')
router.register('matriculas', MatriculaViewSet, basename='Matriculas')

urlpatterns = [
    path('admin/', include('admin_honeypot.urls', namespace='admin_honeypot')),
    path('controle-geral/', admin.site.urls),
    path('', include(router.urls)),
    path('alunos/<int:pk>/matriculas/', ListaMatriculasAluno.as_view()),
    path('cursos/<int:pk>/matriculas/', ListaAlunosMatriculados.as_view()),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)