Advertisement
MadCortez

urls.py

May 16th, 2023
1,036
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.14 KB | None | 0 0
  1. """
  2. URL configuration for movie_library project.
  3.  
  4. The `urlpatterns` list routes URLs to views. For more information please see:
  5.    https://docs.djangoproject.com/en/4.2/topics/http/urls/
  6. Examples:
  7. Function views
  8.    1. Add an import:  from my_app import views
  9.    2. Add a URL to urlpatterns:  path('', views.home, name='home')
  10. Class-based views
  11.    1. Add an import:  from other_app.views import Home
  12.    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
  13. Including another URLconf
  14.    1. Import the include() function: from django.urls import include, path
  15.    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
  16. """
  17. from django.contrib import admin
  18. from django.urls import path
  19. from movies.views import MovieListView, MovieCreateView, MovieDeleteView, MovieUpdateView
  20.  
  21. urlpatterns = [
  22.     path('movies/', MovieListView.as_view(), name='movie_list'),
  23.     path('movies/create/', MovieCreateView.as_view(), name='create_movie'),
  24.     path('movies/delete/<int:movie_id>/', MovieDeleteView.as_view(), name='delete_movie'),
  25.     path('movies/update/<int:movie_id>/', MovieUpdateView.as_view(), name='update_movie'),
  26. ]
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement