Skip to content

Instantly share code, notes, and snippets.

@sankalpjonn
Created November 15, 2020 03:50
Show Gist options
  • Save sankalpjonn/902b7c23e95e3cb4ddf99f1b52bbbe52 to your computer and use it in GitHub Desktop.
Save sankalpjonn/902b7c23e95e3cb4ddf99f1b52bbbe52 to your computer and use it in GitHub Desktop.
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