-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathurls.py
More file actions
28 lines (21 loc) · 1.13 KB
/
urls.py
File metadata and controls
28 lines (21 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from django.conf.urls import url
from . import views
from django.conf import settings
from blog.views import DetailView, UpdateView, DeleteView
app_name = 'blog' #ceci est pour indiquer que tt les noms des url ( details, comment..) appartiennent à l'app blog
urlpatterns = [
# this section contains the different url in /blog/
# /blog/
url(r'^$',views.index_view, name = 'index'),
url(r'^register/$', views.UserFormView.as_view(), name = 'register'),
url(r'^login/$', views.login_user, name = 'login'),
url(r'^logout/$', views.logout_user, name='logout'),
url(r'^(?P<pk>\d+)/$', views.Profil, name = 'profil'),
url(r'^edit/$', views.update_profile, name='edit_profile'),
#/blog/post_id/
url(r'^detail/(?P<pk>\d+)/$', views.DetailView, name = 'detail'),
url(r'^post/add/$', views.post_new, name = 'creat' ),
url(r'^post/(?P<pk>\d+)/$', views.post_edit , name = 'update'),
url(r'^comment/(?P<pk>\w+)/remove/$', views.CommentDeleteView.as_view(), name='comment_remove'),
url(r'^post/(?P<pk>\w+)/delete/$', DeleteView.as_view(), name = 'delete'),
]