Django: Getting Started Transcripts
Chapter: Users and Account Management
Lecture: Login template

Login or purchase this course to watch this video and the rest of the course contents.
0:02 The first template is for logging in. In a later chapter, I'll go into details about Django's form management tools.
0:11 For now, just know that Django has form management tools. The login view passes in a form object to your template.
0:19 You can render that form object by calling its as p method as in paragraph tag This means it will spit out all of the HTML of the form,
0:30 inside of a paragraph tag, essentially filling in this form tag in the HTML. With the form object rendered inside a form tag.
0:39 You're almost ready to go. You just need to submit button to make it slightly prettier, I'm using the B TN and Bt N dark CSS class from bootstrap.
0:50 There is one other piece of magic here. Django has mechanisms built in to protect from cross site scripting attacks, without going into details,
0:59 there's a token that gets passed around here and if it isn't included Django will reject the form submission.
1:06 This C S R F token tag gets replaced with the cross site reference token. Unless you're truly interested,
1:14 This can just be thought of as some magic you have to include if you forget it, Django will scream at you in the deV server console.
1:23 Unfortunately I'm not quite done yet, there's a few more things you need in order to login.


Talk Python's Mastodon Michael Kennedy's Mastodon