From fa14c2b19896000fce61d64d073e7ab549f8548d Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Tue, 25 Jul 2017 18:25:20 +0530 Subject: Add more slides --- tutorial_9_create_login/slides.md | 51 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/tutorial_9_create_login/slides.md b/tutorial_9_create_login/slides.md index be6eb84..9564d9f 100644 --- a/tutorial_9_create_login/slides.md +++ b/tutorial_9_create_login/slides.md @@ -33,4 +33,53 @@ Slide 5: **Modify the urls.py** -- Modify the urls.py file located in the ```blog``` directory +- Modify the urls.py file located in the ```myproject``` folder + + # /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 # Add this import + + + urlpatterns = [ + url(r'^admin/', admin.site.urls), + url(r'^blogs/$', include('blogs.urls')), + url(r'^login/$', auth_views.login, {'template_name': 'login.html'}), # Add this line + ] + +Slide 6: +------------------ + +**Create a new template** + +Create a template login.html at /blog/templates/blog/login.html to look like below + +- Create a template ```login.html``` at ```/blog/templates/blog/login.html``` to look like below + + + +
+ {% csrf_token %} +

+ + + + + + + + + +
{{ form.username.label_tag }}{{ form.username }}
{{ form.password.label_tag }}{{ form.password }}
+

+

+

+ +
+

+ +
+ + + -- cgit