Created
November 15, 2020 03:50
-
-
Save sankalpjonn/902b7c23e95e3cb4ddf99f1b52bbbe52 to your computer and use it in GitHub Desktop.
This file contains hidden or 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.contrib import admin | |
from django.urls import path | |
from notes.views import NoteViewSet | |
from django.conf.urls import url | |
urlpatterns = [ | |
# the admin path is present by default when you create the Django profject. It is used to access the Django admin panel. | |
path('admin/', admin.site.urls), | |
# the URLs for your APIs start from here | |
url(r'^note$', NoteViewSet.as_view( | |
{ | |
'get': 'retrieve', | |
'post': 'create', | |
'put': 'update', | |
'patch': 'partial_update', | |
'delete': 'destroy' | |
} | |
)), | |
url(r'^note/all$', NoteViewSet.as_view( | |
{ | |
'get': 'list', | |
} | |
)), | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment