Created
June 29, 2019 08:46
-
-
Save aballah-chamakh/2b9eadf53ef78982bfaf0f3242f81325 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.urls import path | |
# import function based view | |
from .views import (product_detail_view,product_list_view,product_create_view,product_update_view,product_delete_view) | |
# or class based views (this up to what your choise either you will work with cbv or fbv) | |
from .view import (ProductListView,ProductDetaiView,ProductCreateView,ProductUpdateView,ProductDeleteView) | |
urlpatterns = [ | |
# for function based view | |
path('',product_list_view) | |
path('product/<int:pk>/',product_detail_view) | |
path('product/<int:pk>/create/',product_create_view) | |
path('product/<int:pk>/update/',product_update_view) | |
path('product/<int:pk>/delete/',product_delete_view) | |
# or for class based views | |
path('',ProductListView) | |
path('product/<int:pk>/',ProductDetaiView) | |
path('product/<int:pk>/create/',ProductCreateView) | |
path('product/<int:pk>/update/',ProductUpdateView) | |
path('product/<int:pk>/delete/',ProductDeleteView) | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment