from django.contrib import admin
from django.urls import path , re_path
from . import views
# ใช้`from . ได้ในกรณีอยู่ใน path กับตัว app

urlpatterns = [
    path('', views.index , name='index'),
    path('login/', views.login_view , name='login'),
    path('logout/', views.logout_view , name='logout'),
    path('signup/', views.signup_view , name='signup'),
    path('hello/<int:id>', views.hello , name='hello'),
    re_path(r'article/(?P<year>[0-9]{4})/(?P<slug>[\w-]+)/$', views.article , name='article'),
]

#  ใช้กับ Search Engie
# re_path(r'article/(?P<year>[0-9]{4})/(?P<slug>[\w-]+)/$', views.article),