p00003/main/urls.py
2025-01-11 21:17:52 -05:00

21 lines
931 B
Python

# main/urls.py
from .views import create_project, project_dashboard, create_task
from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .api_views import ProjectViewSet, TaskViewSet, AccountViewSet, UserRegistrationView, UserLoginView, UserLogoutView
router = DefaultRouter()
router.register(r'projects', ProjectViewSet)
router.register(r'tasks', TaskViewSet)
router.register(r'accounts', AccountViewSet)
urlpatterns = [
path('api/', include(router.urls)),
path('accounts/login/', UserLoginView, name='login'),
path('accounts/logout/', UserLogoutView, name='logout'),
path('accounts/register/', UserRegistrationView, name='welcome'),
path('projects/create/', create_project, name='create_project'),
path('projects/<int:project_id>/', project_dashboard, name='project_dashboard'),
path('projects/<int:project_id>/tasks/create/', create_task, name='create_task'),
]