20 lines
873 B
Python
20 lines
873 B
Python
# main/urls.py
|
|
from .views import create_project, project_dashboard, create_task, UserRegistrationView, UserLoginView, UserLogoutView
|
|
from django.urls import path, include
|
|
from rest_framework.routers import DefaultRouter
|
|
from .api_views import ProjectViewSet, TaskViewSet
|
|
|
|
router = DefaultRouter()
|
|
router.register(r'projects', ProjectViewSet)
|
|
router.register(r'tasks', TaskViewSet)
|
|
|
|
urlpatterns = [
|
|
path('api/', include(router.urls)),
|
|
path('login/', UserLoginView.as_view(), name='login'),
|
|
path('logout/', UserLogoutView.as_view(), name='logout'),
|
|
path('register/', UserRegistrationView.as_view(), 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'),
|
|
]
|