Login and Logout - Django Wednesdays ECommerce 7

preview_player
Показать описание
In this video I'll show you how to set up the system to login and logout users of the site.

We'll want people to be able to have their own accounts that they can log into.

Eventually those accounts will keep track of orders and things like that...

#django #codemy #JohnElder

Timecodes

0:00​​ - Introduction
1:24 - Create Login/Logout URLs
2:25 - Create Login Page
3:21 - Create Login/Logout Views
4:04 - Import Django Authenticate
5:30 - Add Links To Navbar
6:14 - Show Links if Logged In/Out
7:35 - Add Form to Login Page
10:40 - Add Form Method and Action
11:07 - Add CSRF Token
11:46 - Logout View Code
12:42 - Login View Code
17:00 - Fix Success Misspelling
18:47 - Test It All Out!
19:39 - Conclusion
Рекомендации по теме
Комментарии
Автор

▶ Watch Django Wednesdays Ecommerce Playlist ✅ Subscribe To My YouTube Channel:
▶ See More At: ✅ Join My Facebook Group:
▶ Get The Code

Codemycom
Автор

Today I learned how to spell success !
By the way thank you for including login, logout in your tutorials !

TheLummen.
Автор

Chanels like this is the reason cause I learned english lenguaje, Muchas gracias!

cristobalvera
Автор

Okay here is something from me sir! I have started learning programming because ı am fed up being pushed around for many things. Yet in time my goals are changed(all be it in a relatively short amount of time) Now I am learning web development because ı wanna help my wife for wish to open her own shop. Well I can help her open her online shop at least :) I have been watching and following you along sir and today while you were adding the alert tag for login and logout ı wondered whether ı can make it for success tag green color and failure red. Well checking out how you add django logic ı tried and it worked. I have never been so happy.

ForRosS
Автор

Great video, I just finished
Waiting for #8
Thank you

technologybysrk
Автор

Muchas gracias, el tutorial me sirvió bastante

yohumano
Автор

Im finally caught up! Cant wait for the next video release... John is the full training for ecom available for purchase on the site at all?

namdarcs
Автор

in the form's action attribute, vs code suggesting lowercase 'post' or it should be "POST"

gopiedits
Автор

hy nice video man...thanks a lot.please upload the next video8.we are waiting

nandhanakb
Автор

Great video,
But i have a problem, messages appear on the admin section when i login or logout 😔

sarrabettaieb
Автор

thank for your video, btw, at 6:38, you used logic "user.is_authenticated", where is it from ?

mihuynh
Автор

How can i handle a forgot password situation for the user

heudydn
Автор

login working only for superuser that was created from django-admin createsuperuser command but it does not work for another users
please solve this problem

gauravmahawarmahawar
Автор

with the else statement for the login_user if user is None the message should be messages.error(request, 'something') not success

python-cx
Автор

Why would my login button not work? When I click the button, nothing happens...

peterhagerty
Автор

I fixed the message box to appear green for success, red for error and gray for info:
{% if messages %}

{% for message in messages %}

{% if message.tags == "success" %}
<div class="alert alert-dismissible alert-success">

{% elif message.tags == "error" %}
<div class="alert alert-dismissible alert-danger">

{% else %}
<div class="alert alert-dismissible alert-light">

{% endif %}

<button type="button" class="btn-close"
{{message}}
</div>

{% endfor %}

{% endif %}

(You also change the "message.success" to "message.error" or ".info" in views.py)

michalisz.
Автор

Is it possible to make it more convenient with this messages. For example that they can dissapear after a few seconds.

revEnga