Exemplo n.º 1
0
from django.contrib.auth.views import LogoutView, LoginView
from django.urls import path
from webapp.views import PhotoIndexView, PhotoView, PhotoCreateView, PhotoUpdateView, PhotoDeleteView
from django.conf.urls.static import static
from django.conf import settings

app_name = 'webapp'

urlpatterns = [
    path('', PhotoIndexView.as_view(), name='index'),
    path('photo/<int:pk>', PhotoView.as_view(), name='photo_view'),
    path('photo/add/', PhotoCreateView.as_view(), name='photo_add'),
    path('photo/<int:pk>/update/',
         PhotoUpdateView.as_view(),
         name='photo_update'),
    path('photo/<int:pk>/delete/',
         PhotoDeleteView.as_view(),
         name='photo_delete'),
    path('login/', LoginView.as_view(), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Exemplo n.º 2
0
from django.urls import path
from django.contrib.auth.views import LoginView, LogoutView

from webapp.views import PhotoListView, PhotoCreateView, PhotoUpdateView, PhotoDeleteView, PhotoDetailView

urlpatterns = [
    path('login/', LoginView.as_view(), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('', PhotoListView.as_view(), name='index'),
    path('create/', PhotoCreateView.as_view(), name='create_photo'),
    path('photo/<int:pk>/update/', PhotoUpdateView.as_view(), name='update_photo'),
    path('photo/<int:pk>/delete/', PhotoDeleteView.as_view(), name='delete_photo'),
    path('photo/<int:pk>/', PhotoDetailView.as_view(), name='detail_photo')
]

app_name = 'webapp'
from django.urls import path, include
from webapp.views import IndexView, PhotoView, PhotoCreateView, PhotoUpdateView, PhotoDeleteView, PhotoChosenView, PhotoRemoveView

app_name = 'webapp'

urlpatterns = [
    path('', IndexView.as_view(), name='index'),

    path('photo/', include([
        path('<int:pk>/', include([
            path('', PhotoView.as_view(), name='photo_view'),
            path('update/', PhotoUpdateView.as_view(), name='photo_update'),
            path('delete/', PhotoDeleteView.as_view(), name='photo_delete'),
            path('chosen/', PhotoChosenView.as_view(), name='photo_choose'),
            path('remove/', PhotoRemoveView.as_view(), name='photo_remove'),
        ])),
        path('create/', PhotoCreateView.as_view(), name='photo_create'),
    ])),
]
Exemplo n.º 4
0
from django.urls import path
from webapp.views import IndexView, PhotoView, PhotoCreateView, PhotoUpdateView, PhotoDeleteView, login_view, \
    logout_view

app_name = 'webapp'

urlpatterns = [
    path('', IndexView.as_view(), name='index'),
    path('photo/<int:pk>/', PhotoView.as_view(), name='photo_view'),
    path("photo/add/", PhotoCreateView.as_view(), name="photo_add"),
    path('photo/<int:pk>/edit/', PhotoUpdateView.as_view(), name='photo_update'),
    path("photo/<int:pk>/delete", PhotoDeleteView.as_view(), name="photo_delete"),
    path("login/", login_view, name="login"),
    path("logout/", logout_view, name="logout"),


]