def testFirstPage(self): movie_list_path = reverse('movies:movie_list') request = RequestFactory().get(path=movie_list_path) response = MovieListView.as_view()(request) self.assertEqual(200, response.status_code) self.assertTrue(response.context_data['is_paginated']) self.assertInHTML( self.ACTIVE_PAGINATION_HTML.format(movie_list_path, 1, 1), response.rendered_content)
from django.urls import path from movies.views import Create_movie, Create_actor, MovieListView, ActorListView app_name = 'movies' urlpatterns = [ path('movie/create', Create_movie.as_view(), name="create_movie"), path('actor/create', Create_actor.as_view(), name="create_actor"), path('movie/list', MovieListView.as_view(), name="movie_list"), path('actor/list', ActorListView.as_view(), name="actor_list"), ]
""" from django.contrib import admin from django.urls import path, include from django.contrib.auth import views as auth_views from django.urls import reverse_lazy from userena import settings as userena_settings from userena import views as userena_views from movies.views import HomePageView, MovieListView, MovieDetailView, MovieCreateView, MovieUpdateView, MovieDeleteView from movierent.views import MovieRentView, MovieRentListView from django.conf.urls.i18n import i18n_patterns urlpatterns = [ path('i18n/', include('django.conf.urls.i18n'), name='set_language'), ] urlpatterns = i18n_patterns( path('admin/', admin.site.urls), path('',HomePageView.as_view(), name = 'home'), path('customers/', include ('userena.urls')), path('movies/',MovieListView.as_view(), name = 'movie-list'), path('movie/<slug:slug>',MovieDetailView.as_view(), name='movie-detail'), path('movie/add', MovieCreateView.as_view(), name='movie-create'), path('movie/<slug:slug>/update', MovieUpdateView.as_view(), name='movie-update'), path('movie/<slug:slug>/delete', MovieDeleteView.as_view(), name = 'movie-delete'), path('movie/<slug:pk>/reserve/', MovieRentView.as_view(), name='movie-rented'), path('movies/out', MovieRentListView.as_view(), name='movie-rented-list'), )
"""movieresources URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url from django.contrib import admin from movies.views import index, init, MovieListView, SearchListView urlpatterns = [ url(r'^init', init), url(r'api/movieslist', MovieListView.as_view()), url(r'api/searchlist', SearchListView.as_view()), url(r'^guard', admin.site.urls), url(r'', index), ]
from django.conf.urls import url from movies.views import MovieListView urlpatterns = [ url(r'^$', MovieListView.as_view(), name="movie_list") ]
from movies.views import PersonViewSet, MovieListView from rest_framework import urls, routers, serializers, viewsets from django.urls import path, include router = routers.DefaultRouter() # router.register(r"person", PersonViewSet) urlpatterns = [ path("", MovieListView.as_view(), name="movie_list_view"), # path("", include(router.urls)), # path("movie_add_update/", MovieCreateView.as_view(), name="movie_list_view"), ]
from django.conf.urls import url from movies.views import ( MovieDetailView, MovieListView, ) urlpatterns = [ url( r'^search/?$', MovieListView.as_view(), name='movie-search', ), url( r'^(?P<movie_id>[\w-]+)/?$', MovieDetailView.as_view(), name='movie-id', ), ]
from django.urls import path from movies.views import MovieListView, MovieSingleView urlpatterns = [ path('movies', MovieListView.as_view()), path('movies/<pk>', MovieSingleView.as_view()) ]
Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url from django.contrib import admin from movies.views import MovieAdd, MovieListView, MovieDetail, UpdateMovie, MovieListHome, ShowAdd, ShowListView, UpdateShow, ScreenAdd, ScreenListView, UpdateScreen, DeleteMovie, DeleteShow, DeleteScreen from movies.views import CarousalAdd, CarousalListView, UpdateCarousal urlpatterns = [ url(r'^$', MovieListHome.as_view(), name='m_lst_hme'), url(r'^m_add/', MovieAdd.as_view(), name='movies_add'), url(r'^mlstview/', MovieListView.as_view(), name='m_lstview'), url(r'^mdetail/(?P<pk>[0-9]+)/$', MovieDetail.as_view(), name='m_d_view'), url(r'^mupdate/(?P<pk>[0-9]+)/$', UpdateMovie.as_view(), name='m_up_view'), url(r'^mdelete/(?P<pk>[0-9]+)/$', DeleteMovie.as_view(), name='m_del_view'), # url(r'^bview/',BaseView.as_view(),name='b_view'), url(r'^s_add/', ShowAdd.as_view(), name='s_add'), url(r'^slview/', ShowListView.as_view(), name='s_lstview'), url(r'^supdate/(?P<pk>[0-9]+)/$', UpdateShow.as_view(), name='s_up_view'), url(r'^sdelete/(?P<pk>[0-9]+)/$', DeleteShow.as_view(), name='s_del_view'), url(r'^sc_add/', ScreenAdd.as_view(), name='sc_add'), url(r'^sclview/', ScreenListView.as_view(), name='sc_lstview'), url(r'^scupdate/(?P<pk>[0-9]+)/$', UpdateScreen.as_view(), name='sc_up_view'),
"""movie_list URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin from django.urls import path from movies.views import MovieListView urlpatterns = [ path('', MovieListView.as_view(), name='movies'), path('movies/', MovieListView.as_view(), name='movies'), path('admin/', admin.site.urls), ]
from django.conf.urls import url from movies.views import MovieListView, MovieDetailView, EditMovie, AddMovie, DeleteMovie, RateMovie from movie_ratings.views import CommentDetailView, EditComment, AddComment, DeleteComment, RestoreComment from django.contrib.auth.decorators import permission_required urlpatterns = [ url(r'^$', MovieListView.as_view(), name='movies_list'), url(r'comments/edit/(?P<pk>\d+)', EditComment.as_view(), name="comment-edit"), url(r'comments/add', AddComment.as_view(), name="comment-add"), url(r'comments/delete', DeleteComment.as_view(), name="comment-delete"), url(r'comments/restore', RestoreComment.as_view(), name="comment-restore"), url(r'comments/(?P<pk>\d+)', CommentDetailView.as_view(), name="comment-detail"), url(r'edit/(?P<pk>\d+)', EditMovie.as_view(), name="movie_edit"), url(r'delete/(?P<pk>\d+)', permission_required('movie.delete')(DeleteMovie.as_view()), name="movie_delete"), url(r'add', permission_required('movie.add')(AddMovie.as_view()), name="movie_add"), url(r'rate/(?P<pk>\d+)', RateMovie.as_view(), name="rate"), url(r'(?P<pk>\d+)', MovieDetailView.as_view(), name='detail'), ]
from django.contrib.auth.decorators import login_required from movies.views import MovieListView, MovieDetailView, VotesView, LastCommentView from django.conf.urls import url from main.models import LikeDislike from .models import Movie, Comment from .views import addviews, add_comment urlpatterns = [ url(r'^(?P<pk>\d+)/$', MovieListView.as_view(), name="movies_index"), url(r'^(?P<pk>\d+)/detail/$', MovieDetailView.as_view(), name="movies_detail"), url(r'^like/(?P<pk>\d+)/$', login_required( VotesView.as_view(model=Movie, vote_type=LikeDislike.LIKE)), name='article_like'), url(r'^dislike/(?P<pk>\d+)/$', login_required( VotesView.as_view(model=Movie, vote_type=LikeDislike.DISLIKE)), name='article_dislike'), url(r'^comment/(?P<pk>\d+)/like/$', login_required( VotesView.as_view(model=Comment, vote_type=LikeDislike.LIKE)), name='comment_like'), url(r'^comment/(?P<pk>\d+)/dislike/$', login_required( VotesView.as_view(model=Comment, vote_type=LikeDislike.DISLIKE)), name='comment_dislike'), url(r'^addview/(?P<view_id>[0-9]+)/$', addviews, name='addviews'), url(r'^comment/(?P<movie_id>[0-9]+)/$', add_comment, name='add_comment'), url(r'^last_comment/$', LastCommentView.as_view(), name='last_comment'),
from django.urls import path from movies.views import MovieCreateView, MovieListView, MovieDetailView, MovieUpdateView, MovieDeleteView app_name = 'movies' urlpatterns = [ path('adicionar/', MovieCreateView.as_view(), name='create'), path('listar/', MovieListView.as_view(), name='list'), path('<int:pk>/detalhes/', MovieDetailView.as_view(), name='detail'), path('<int:pk>/atualizar/', MovieUpdateView.as_view(), name='update'), path('<int:pk>/deletar/', MovieDeleteView.as_view(), name='delete'), ]
from django.urls import path from movies.views import ( MovieListView, MovieDetailView, MovieCreateView, MovieUpdateView, ) app_name = "movies" urlpatterns = [ path("", MovieListView.as_view(), name="movies"), path("create", MovieCreateView.as_view(), name="movie_create"), path("update/<int:pk>", MovieUpdateView.as_view(), name="movie_update"), path("<int:pk>", MovieDetailView.as_view(), name="movie_detail"), ]
from django.urls import path from django.conf.urls import url from movies.views import MovieListView, MovieDetailView, MovieCreateView urlpatterns = [] urlpatterns += [ url(r'^$', MovieListView.as_view(), name='movie_list'), url(r'^create/$', MovieCreateView.as_view(), name='movie_create'), url(r'^movie/(?P<pk>[-\w]+)/$', MovieDetailView.as_view(), name='movie_detail'), ]