Skip to content

Instantly share code, notes, and snippets.

@luiscberrocal
Last active October 25, 2018 21:53
Show Gist options
  • Save luiscberrocal/8ce448ea020c7f3de49fbd0fb18a4197 to your computer and use it in GitHub Desktop.
Save luiscberrocal/8ce448ea020c7f3de49fbd0fb18a4197 to your computer and use it in GitHub Desktop.
CRUD Urls for Django 1.11
urlpatterns = [
url(r'^$', $MODEL$ListView.as_view(), name='list'),
url(r'^create/$', $MODEL$CreateView.as_view(), name='create'),
url(r'^update/(?P<pk>\d+)/$', $MODEL$UpdateView.as_view(), name='update'),
url(r'^delete/(?P<pk>\d+)/$', $MODEL$DeleteView.as_view(), name='delete'),
url(r'^(?P<pk>\d+)/$', $MODEL$DetailView.as_view(), name='detail'),
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment