Пример #1
0
from django.contrib.auth.views import LoginView, LogoutView
from django.urls import path
from accountapp.views import AccountCreateView, AccountDetailView, AccountUpdateView, AccountDeleteView

app_name = "accountapp"

urlpatterns = [

    path('login/', LoginView.as_view(template_name = 'accountapp/login.html'), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),

    path('create/', AccountCreateView.as_view(), name='create'),
    path('detail/<int:pk>', AccountDetailView.as_view(), name='detail'),
    path('update/<int:pk>', AccountUpdateView.as_view(), name='update'),
    path('delete/<int:pk>', AccountDeleteView.as_view(), name='delete'),

]

Пример #2
0
from django.contrib.auth.views import LoginView, LogoutView
from django.urls import path

from accountapp.views import AccountCreateView, \
    AccountDetailView, AccountUpdateView, AccountDeleteView

app_name = "accountapp"

urlpatterns = [
    path('login/',
         LoginView.as_view(template_name='accountapp/login.html'),
         name="login"),
    path('logout/', LogoutView.as_view(), name="logout"),
    path('create/', AccountCreateView.as_view(), name="create"),
    path('detail/<int:pk>/', AccountDetailView.as_view(), name="detail"),
    path('update/<int:pk>/', AccountUpdateView.as_view(), name="update"),
    path('delete/<int:pk>/', AccountDeleteView.as_view(), name="delete"),
]
Пример #3
0
from django.contrib.auth.views import LoginView, LogoutView
from django.urls import path

from accountapp.views import AccountCreateView, Hello_World, AccountDetailView, AccountUpdateView, AccountDeleteView

app_name = "accountapp"

urlpatterns = [
        path('hello_world/', Hello_World, name="hello_world"),
        path('create/', AccountCreateView.as_view(), name="create"),    ##as_view()라는 것을 붙여주어야 한다.

        path('login/', LoginView.as_view(template_name='accountapp/login.html'), name='login'),    ##login view에는 탬플릿을 설정해 주어야 한다.
        path('logout/', LogoutView.as_view(), name='logout'),    
        path('detail/<int:pk>', AccountDetailView.as_view(), name='detail'), ##pk는 해당 user의 고유 정보 값
        path('update/<int:pk>', AccountUpdateView.as_view(), name='update'), ##pk는 해당 user의 고유 정보 값
        path('delete/<int:pk>', AccountDeleteView.as_view(), name='delete'), ##pk는 해당 user의 고유 정보 값
]
Пример #4
0
from django.urls import path
from accountapp.views import AccountCreateView, AccountDetailView, AccountUpdateView, AccountDeleteView
from django.contrib.auth.views import LoginView, LogoutView
app_name = 'accountapp'

urlpatterns = [
    path('login/',
         LoginView.as_view(template_name='accountapp/login.html'),
         name='login'),
    # LoginView 같은 경우는 템플릿을 지정해줘야 한다.(직접 만들것임.)
    path('logout/', LogoutView.as_view(), name='logout'),
    # LoginView와 LogoutView 둘다 import 필요.
    path('create/', AccountCreateView.as_view(), name='create'),
    path('detail/<int:pk>', AccountDetailView.as_view(), name='detail'),
    path('update/', AccountUpdateView.as_view(), name='update'),
    path('delete/<int:pk>', AccountDeleteView.as_view(), name='delete')
]