Exemple #1
0
"""REST_movies URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.10/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 MovieView, MoviesView, PeopleView, PersonView

urlpatterns = [
    url(r'^admin/$', admin.site.urls),
    url(r'^movies/$', MoviesView.as_view()),
    url(r'^movie/(?P<id>(\d)+)/$', MovieView.as_view()),
    url(r'^people/$', PeopleView.as_view()),
    url(r'^person/(?P<id>(\d)+)/$', PersonView.as_view()),
]
Exemple #2
0
"""REST_Server URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.10/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 MoviesView, MovieView, PersonsView, PersonView

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^movies/$', MoviesView.as_view(), name='movies'),
    url(r'^movies/(?P<id>(\d)+)', MovieView.as_view(), name='movies'),
    url(r'^persons/$', PersonsView.as_view(), name='persons'),
    url(r'^persons/(?P<id>(\d)+)', PersonView.as_view(), name='movie')
]
Exemple #3
0
"""Django 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 MoviesView, MovieView

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^movies/$', MoviesView.as_view(), name="movies"),
    url(r'^movies/(?P<movie_id>(\d)+)', MovieView.as_view(), name="movie"),
]
Exemple #4
0
from django.urls import path
from movies.views import MoviesView, MoviesPeopleMapping

urlpatterns = [
    path("movies/", MoviesView.as_view(), name="movies-list"),
    path('people/', MoviesPeopleMapping.as_view(),
         name='movies-people-mapping'),
]
Exemple #5
0
"""work6 URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.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 MoviesView, MovieView, PersonView, PersonsView, AssignDirectorMovie, dziwnyWidok

urlpatterns = [
    path('admin/', admin.site.urls),
    path('movies', MoviesView.as_view()),
    path('movies/<int:id>', MovieView.as_view()),
    path('persons/<int:id>', PersonView.as_view()),
    path('persons/', PersonsView.as_view()),
    path('movies/<int:movie_id>/director/<int:person_id>',
         AssignDirectorMovie.as_view()),
    path('s', dziwnyWidok),
]
Exemple #6
0
from django.conf.urls import include, url
from django.urls import path
from django.contrib import admin
from movies.views import ListMovies, MoviesView, AddComment, CommentsView, Top

urlpatterns = [
    path('admin/', admin.site.urls),
    url(r'^movies/$', ListMovies.as_view(), name='start'),
    url(r'^movies/(?P<pk>[0-9]+)/$', ListMovies.as_view(), name='movie'),
    url(r'^movies/list/$', MoviesView.as_view(), name='movies_list'),
    url(r'^comments/(?P<pk>[0-9]+)/$', AddComment.as_view(), name='comment'),
    url(r'^comments/list/$', CommentsView.as_view(), name='comments_list'),
    url(r'^top/$', Top.as_view(), name='top'),
]
Exemple #7
0
from django.conf.urls import url
from django.contrib import admin
from movies.views import MoviesView

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    # url(r'^movies/', MoviesView.as_view(), name='movies'),
    url(r'^movies/(?P<id>[\w\W]*)', MoviesView.as_view(), name='moviesget')
]
Exemple #8
0
"""rest URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.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 (MoviesView, MovieView, PeopleView, PersonView)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('movies/', MoviesView.as_view(), name='all_movies'),
    path('movie/<int:id>/', MovieView.as_view(), name='movie'),
    path('people/', PeopleView.as_view(), name='people'),
    path('person/<int:id>/', PersonView.as_view(), name='person'),
]
Exemple #9
0
from django.urls import path
from movies.views import MoviesView, MovieDetail, CreateMovie, UpdateMovie

app_name="movies"

urlpatterns = [
  path("", MoviesView.as_view(), name="movies"),
  path("<int:pk>", MovieDetail.as_view(), name="movie"),
  path("<int:pk>/update", UpdateMovie.as_view(), name="update"),
  path("create", CreateMovie.as_view(), name="create"),
]
Exemple #10
0
from django.urls import path
from movies.views import MoviesView, MovieDetail, CreateMovie, UpdateMovie

app_name = "movies"

urlpatterns = [
    path("", MoviesView.as_view(), name="list"),
    path("<int:pk>/", MovieDetail.as_view(), name="movie"),
    path("<int:pk>/update/", UpdateMovie.as_view(), name="update"),
    path("create/", CreateMovie.as_view(), name="create"),
]