diff options
author | ankitjavalkar | 2017-07-26 18:55:21 +0530 |
---|---|---|
committer | GitHub | 2017-07-26 18:55:21 +0530 |
commit | 48f15ae5bc604e8ed54cd6082294fe3af85f71a4 (patch) | |
tree | 1c5e8e826e5cd0d854b82e10dc30d0691fcd04db | |
parent | c5a4e6de19a0a93586f04344698d94c298225386 (diff) | |
download | learn_django-48f15ae5bc604e8ed54cd6082294fe3af85f71a4.tar.gz learn_django-48f15ae5bc604e8ed54cd6082294fe3af85f71a4.tar.bz2 learn_django-48f15ae5bc604e8ed54cd6082294fe3af85f71a4.zip |
Finish slide
-rw-r--r-- | tutorial_9_create_login/slides.md | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/tutorial_9_create_login/slides.md b/tutorial_9_create_login/slides.md index 9f55466..54762ea 100644 --- a/tutorial_9_create_login/slides.md +++ b/tutorial_9_create_login/slides.md @@ -9,8 +9,8 @@ Slide 2 [00:12 | 00:20] **Learning Objectives** In this tutorial, we will learn to; - - Create a new form - - Create a new view to handle form submission + - Create login functionality + - Using django built-in login and logout functions Slide 3 [00:11 | 00:31] --------------- @@ -147,4 +147,30 @@ Example: def edit_articles(request, article_id): ` ... +Slide 9: +--------------------- + +**Add logout url** + +- Modify the ```urls.py``` located in + + # myproject/urls.py + + from django.conf.urls import include, url + from django.contrib import admin + from blog import views + from django.contrib.auth import views as auth_views + from blog.forms import LoginForm + + urlpatterns = [ + url(r'^admin/', admin.site.urls), + url(r'^blogs/$', include('blogs.urls')), + url(r'^login/$', auth_views.login, {'template_name': 'login.html', 'authentication_form': LoginForm}}), + url(r'^logout/$', auth_views.logout, {'next_page': '/login'}), # Add this line + ] + +Slide 10: +--------------------- + +- Add a link to the ```/logout``` url to the templates |