Python Django Tutorial: Full-Featured Web App Part 7 - Login and Logout System

  Рет қаралды 477,578

Corey Schafer

Corey Schafer

Күн бұрын

Пікірлер: 638
@ccandour
@ccandour 9 ай бұрын
If you're using Django 5 or higher you will encounter the problem with accessing the 'logout' page directly from the browser like Corey does. This is because the logout endpoint can be accessed now only using a 'POST' method, and accessing it via a URL is using the 'GET' method. One of the ways you can resolve this issue is to add this short code snippet instead of the standard link element in the navbar: {% csrf_token %} Logout Doesn't look perfect but it works :) Hope this helps!
@GanaderIA-qv6fh
@GanaderIA-qv6fh 9 ай бұрын
I was just running into this issue yesterday! Thanks!! Would like to see a way we can keep the anchor instead of having to use a btn though.
@tarik_el_oukili
@tarik_el_oukili 8 ай бұрын
Thanks man
@SachiSisodia-lc6zj
@SachiSisodia-lc6zj 7 ай бұрын
tysm!
@Incognito-rr5ic
@Incognito-rr5ic 6 ай бұрын
Thanks man.
@perezjoshua2541
@perezjoshua2541 6 ай бұрын
Thanks a lot
@rishabhkumar5611
@rishabhkumar5611 6 жыл бұрын
I love it how he says - " We'll fix that in just a second " and actually fixes it quite well in a second :)
@python4692
@python4692 3 жыл бұрын
He knows what he's doing!
@solomonjayceon1284
@solomonjayceon1284 3 жыл бұрын
i guess im asking the wrong place but does anybody know a way to log back into an instagram account..? I stupidly lost the login password. I appreciate any help you can offer me
@maximomohamed2909
@maximomohamed2909 3 жыл бұрын
@Solomon Jayceon instablaster =)
@solomonjayceon1284
@solomonjayceon1284 3 жыл бұрын
@Maximo Mohamed I really appreciate your reply. I got to the site through google and im in the hacking process now. Looks like it's gonna take quite some time so I will get back to you later with my results.
@solomonjayceon1284
@solomonjayceon1284 3 жыл бұрын
@Maximo Mohamed It did the trick and I now got access to my account again. I'm so happy:D Thanks so much, you really help me out !
@Canda-fh4xc
@Canda-fh4xc 6 жыл бұрын
This is my second tutorial series with you. I already finished Python Flask Tutorial. I watched multiple Django tutorials. Free (blogs and KZbin) AND Paid(Udemy, edx,..). Your way of teaching is completely different. You are real instructor. You made Django/python really simple to anyone who wants to learn the language. I will make sure to share your KZbin Tutorial Channel with everyone I know/meet Thank you so much,
@coreyms
@coreyms 6 жыл бұрын
Thanks!
@raskotimagar.21
@raskotimagar.21 10 ай бұрын
while trying logout im getting, This page isn’t workingIf the problem continues, contact the site owner. HTTP ERROR 405 error. what should i do?!
@Canda-fh4xc
@Canda-fh4xc 10 ай бұрын
@@raskotimagar.21 "Method Not Allowed" error. Check the URL Routing
@phantomtrouper2652
@phantomtrouper2652 9 ай бұрын
@@raskotimagar.21 {% if user.is_authenticated %} {% csrf_token %} Logout {% else %} Login Register {% endif %}
@thiagokkawakita
@thiagokkawakita 9 ай бұрын
This method is obsolete, google "405 logout" @@raskotimagar.21
@sarthakbhutani7413
@sarthakbhutani7413 4 жыл бұрын
I really love that : "we haven't created this yet but we will in just a second"! God bless you sir.
@waleedabdulmanea5301
@waleedabdulmanea5301 4 жыл бұрын
I like when he says, 'we are gonna fix this in a second', the instructor is reading our minds, good job, and keep the great work, i am one of your students :)
@sharathkrishnan1558
@sharathkrishnan1558 4 жыл бұрын
Not only are these tutorials the best.. But the way you explain, it motivates me to carry on further and it really creates interest in the subject
@congcuongnguyen413
@congcuongnguyen413 2 жыл бұрын
0:31 built-in login/logout page for user 1:02 import auth_views & create path 2:53 create templates for those views 8:37 setting login_redirect_url 11:28 redirect to login page after register 12:32 create template for logout page 16:37 change navigation bar base on login/logout 18:20 built-in user variable contain current user 20:55 restriction on certain route if not login 21:47 create profile view & template & URL 25:57 login_required decorator 27:50 setting login_url 28:43 ?next=...
@raskotimagar.21
@raskotimagar.21 10 ай бұрын
while trying logout im getting, This page isn’t workingIf the problem continues, contact the site owner. HTTP ERROR 405 error. can you help me please
@minsuga2988
@minsuga2988 9 ай бұрын
Did the error get solved can u tell me how
@mychal.b
@mychal.b 9 ай бұрын
@@raskotimagar.21 im having the same error. in the command line it says Method Not Allowed (GET): /logout/ but i dont know how to fix it
@mychal.b
@mychal.b 9 ай бұрын
@@raskotimagar.21 {% csrf_token %} logout try this
@thiagokkawakita
@thiagokkawakita 9 ай бұрын
This method is obsolete, google "405 logout"@@mychal.b
@erwinnovo3014
@erwinnovo3014 Ай бұрын
These video tutorials are just truly amazing! Thanks and kudos Corey!
@aminuolawale1843
@aminuolawale1843 4 жыл бұрын
Your Flask Series helped me land my current Python job! You are a great teacher !
@toastrecon
@toastrecon 5 жыл бұрын
Amazing how much functionality is available right out of the box. Thanks, Corey!
@justinlee3453
@justinlee3453 3 жыл бұрын
Thanks corey, I've gone over this for the third time, and now this totally makes sense
@jamesskipworth5142
@jamesskipworth5142 4 жыл бұрын
Suggestion for anyone recreating to add 'redirect_authenticated_user=True' at 4:50 so already logged in users are redirected through the login page. Loved the series though Corey really helped with my school project.
@lightninginmyhands4878
@lightninginmyhands4878 5 жыл бұрын
27:50 `LOGIN_URL` is used to override Django's default URL when a user is trying to access a `login_required` site. We have created our own login route thus `LOGIN_URL` will be assigned to that.
@shikunchen8523
@shikunchen8523 4 жыл бұрын
how can we fix it when login the page always redirects to the home page instead of profile page?
@imawo
@imawo 10 ай бұрын
i'm encountring the same problem . did yo get where's the problem?@@shikunchen8523
@commonsense1019
@commonsense1019 Жыл бұрын
his clearity about the concepts is visible through his advance yet easy to understand explaination
@sebastianb2092
@sebastianb2092 4 жыл бұрын
Like I'm watching these videos for 3 days now every day after work and continuingly learning about Python and the Django framework. Love it @Corey Schafer
@romnegrillo
@romnegrillo 3 жыл бұрын
You can still view the login page even though you're logged in. You can change your login route as: path("login/", auth_views.LoginView.as_view(template_name = "users/login.html", redirect_authenticated_user=True), name="login"), so it will be reditected to blog-home route when you try to access the login page even though you;re authenticated. I'm loving this series. Your tutorial is really good. You explain complex problems into simple terms.
@demaxl732
@demaxl732 Жыл бұрын
Thanks
@jayedm3342
@jayedm3342 5 жыл бұрын
i dont know why the channels sharing knowledge have only 100k+ subs while nonsense channels have milliions ... GUYS lets hit that subs red btn and make it to million+
@grouchydrago1396
@grouchydrago1396 4 жыл бұрын
Trust me I have
@MagnusAnand
@MagnusAnand 5 жыл бұрын
This tutorial is becoming better in every video
@pranjalrai-f7g
@pranjalrai-f7g 9 ай бұрын
I love it how you taught any topic in such a easy way In my project on opening logout page it was showing 405 error and page breakdown. I have tried various thing but it was not helping so help me in this.
@tigger2581
@tigger2581 4 жыл бұрын
hands down best tutorials on youtube. and ive watched many
@vp9041
@vp9041 6 жыл бұрын
Annoyed in the past about not having that next function, truly a nice feature, well explained nice video
@doniyorabduvokhidov1862
@doniyorabduvokhidov1862 4 жыл бұрын
The best Django tutorial I've ever seen .. thank you for all of your effort .. really appreciate
@roshanpandey5357
@roshanpandey5357 5 жыл бұрын
Well, this video is awesome as others of the same series. Just loved it :-)
@geolegacy2
@geolegacy2 5 жыл бұрын
7 videos in and so far still so good! God bless
@tahhaa906
@tahhaa906 3 жыл бұрын
I Really like when he says : " that django provides for us ".
@olhamarushchak3514
@olhamarushchak3514 6 жыл бұрын
Love you so much!! Thank you for this Django course, I've been waiting for so long!
@ABASSANIMERIKUKU
@ABASSANIMERIKUKU 3 ай бұрын
You are just the best.....Django is just sinking into my head
@Klutche
@Klutche 3 жыл бұрын
I can't wait to bring my idea to life with your guidance! Thanks Corey for all you've done! I will follow up once i've deployed my first app!
@ASADULLAHGALIB25
@ASADULLAHGALIB25 5 жыл бұрын
Corey Schafer, you are the best teacher 👌
@suryamanipandey8002
@suryamanipandey8002 3 жыл бұрын
this series is so amazing that its hard to put in words. Thank you for teaching so much in so less time.
@banaras.wala.foreignaala
@banaras.wala.foreignaala 4 жыл бұрын
Hi Corey, So far so good, I want to say thanks for your efforts.
@andrewchen7710
@andrewchen7710 6 жыл бұрын
Thank you so much Corey! Really helps my startup on building on page! Whether we succeed or not we owe a huge one to you!
@coreyms
@coreyms 6 жыл бұрын
Good luck! What kind of startup?
@NphiniT
@NphiniT 6 жыл бұрын
@@coreyms I am gonna use this for my startapp too. It is basically an online bus ticket booking system for travelling within Ghana. I plan on creating Android and iOS Apps for it as well. Any advice and Pointers??
@ALEXEIS
@ALEXEIS 5 жыл бұрын
@@NphiniT You need a partner?
@NphiniT
@NphiniT 5 жыл бұрын
@@ALEXEIS How good is your front-end development? E-mail me: nurudeen.karim2016@gmail.com
@godfreynolottyogwu8562
@godfreynolottyogwu8562 5 жыл бұрын
@@NphiniT great idea
@harwinderthakur9708
@harwinderthakur9708 4 жыл бұрын
I was surprised to see how well crispy forms work with django . It's like a magic don't have to do anything.
@shreyas0002
@shreyas0002 5 жыл бұрын
Basically Corey Is A Magician, Guy Knows What problem will arise due to every Small Changes in code and even fixes it!
@akshaykaushik9
@akshaykaushik9 4 жыл бұрын
love you bro.Watched every video available on your channel. Everything learned from you. Feels like i know python as intermediate although it is hard to keep remember every topic.
@godeytech
@godeytech 2 жыл бұрын
I really love this. Easy to understand and easy to practice on your own
@GDLAPROD
@GDLAPROD 2 жыл бұрын
Wow! Impressive. Everything is still relevant.
@liviumircea6905
@liviumircea6905 5 жыл бұрын
amazing ...one of the best tutorials on django
@xdlandxd5773
@xdlandxd5773 4 ай бұрын
if someones nav bar doesnt refresh on login or logout, mayby its bcs of ..LoginView... in logout path: path('logout/', auth_views.LoginView.as_view(template_name='users/logout.html'), name='logout'), in urls.py file most funny thing on this problem is no one else have this problem... took me a while to fix like anyone else, great tutorial, thank you, Corey!
@anandkumar-wf1so
@anandkumar-wf1so Ай бұрын
hey can u tell me the fix for this?
@vegadevelopers
@vegadevelopers 9 ай бұрын
Thank you so much with details explanations and teaching. 👌👌👌 Quality Tutorial!
@slan7
@slan7 5 жыл бұрын
God-tier tutorials. Thank you, sir.
@shadow_was_here
@shadow_was_here 4 жыл бұрын
The Best django tutorial.. Love your teachings man. Great work.
@olaniyiajayi8012
@olaniyiajayi8012 11 ай бұрын
If you have error 405 page on logout page it may be due to latest django version this is what I did to get round it. In users views folder i put this code from django.contrib.auth import logout def logout_view(request): logout(request) return render(request, 'users/logout.html') then in main project urls I put this in urr parttern list path("logout/", user_views.logout_view, name="logout"), You can comment out the former url path of logout
@jaedenhero548
@jaedenhero548 11 ай бұрын
Works. Thank you very much!
@maxchapin52
@maxchapin52 10 ай бұрын
This worked! Thank you!
@danihlzita2345
@danihlzita2345 10 ай бұрын
Worked out perfectly! Thanks a lot!!!
@dragonladycrafts
@dragonladycrafts 10 ай бұрын
Thank you so much. This helped me out a lot.
@jonathanbriones3235
@jonathanbriones3235 9 ай бұрын
hey guys, this is the way. it worked for me!
@shailkardani8159
@shailkardani8159 3 жыл бұрын
Those who started learning Django for the first dont start. First watch the Flask series by Corey. This series will then be much easier for you. Both the series are master class. You wont find such rich content on any other platform.
@ashrafulfuad2967
@ashrafulfuad2967 5 жыл бұрын
Thank you so much I learned total django from your tutorial series . now my project is going on
@mhmt_dmr
@mhmt_dmr 4 жыл бұрын
Thanks Corey for the perfect lessons. 40 dislike comes from udemy sellers :)
@PrieyudhaAkaditaS
@PrieyudhaAkaditaS 4 жыл бұрын
The best django tutorial ive ever seen. Thankyou
@paridhigupta2747
@paridhigupta2747 2 жыл бұрын
Best teacher ever.
@abdulahamer6238
@abdulahamer6238 4 жыл бұрын
Super cool adding features and helping to put students in a user mindset to see functionality and feedback that users will enjoy and will help make things feel intuitive and easy to use
@fariborzseyedi9711
@fariborzseyedi9711 4 жыл бұрын
Very Very nice videos. thank you Corey. I will suggest this tutorial to every one that want learn Django.
@wentaoqiu4072
@wentaoqiu4072 5 жыл бұрын
You’re a teaching god.
@derekkroeker4582
@derekkroeker4582 3 жыл бұрын
3:37 Got that one many times... Didn't get exactly "TemplateDoesNotExist" on the other videos, but this time yes.
@Marek-zt9fy
@Marek-zt9fy 5 жыл бұрын
I love your tutorials, you're amazing man, keep it up!
@pratikchakravorty6623
@pratikchakravorty6623 5 жыл бұрын
Great video. Just one small thing to not let the user go back and access the register and login page after they have logged in add the redirected_authenticated_user=TRUE to the login path in the project's urlconf and also add a check to the register view. You can access the user using request.user
@SandeepPareek1
@SandeepPareek1 3 жыл бұрын
oh you are the best guy !.... really good tutorials.. keep the good work up .. 1000 thumbs up for you .
@superrelaxation508
@superrelaxation508 Жыл бұрын
Going amazing so far best instructor suggest according to chatgpt and it is true thanks sir
@moebazzi8412
@moebazzi8412 6 жыл бұрын
AMAZING AND CLEAR TUTORIALS WELL DONE COREY!!!
@lkarthik1985
@lkarthik1985 6 жыл бұрын
Hi Corey, Thanks for this excellent video.
@albertoleaplaza3048
@albertoleaplaza3048 4 жыл бұрын
The Best Videos I have seen so far!!!!
@namesare4fools
@namesare4fools 5 жыл бұрын
LOVE IT !! I would like to see a more advance django tutorials.. :)
@harshbhatt4527
@harshbhatt4527 3 жыл бұрын
Sir great work I have not seen a django playlist like this!!!
@ashG1234
@ashG1234 5 жыл бұрын
Dear Corey THANK YOU for producing such wonderful videos. Much appreciated. I would request you to produce 2 more videos - 1) Token Based authentication (must required for REST apps) and 2) Use of the token for fetching information.
@xintongliu8068
@xintongliu8068 4 жыл бұрын
Brief conclusion for the video: 1. how to create login, logout and simple profile page. Unlike register, login are provided by django, so remember to check settings.py when you play with login. 2. how to use decorator for profile in view.py.
@ahmedbadal3795
@ahmedbadal3795 4 жыл бұрын
Hey bro the login form is not generating only login button is there and there is not error
@jear3559
@jear3559 6 жыл бұрын
Hi Corey, Thanks for this tutorial... it helps me a lot...
@wozdog7425
@wozdog7425 4 жыл бұрын
something about you Corey ... I always come away feeling smarter !!
@muhammadyaseenmughal3537
@muhammadyaseenmughal3537 3 жыл бұрын
BEST SERIES ON INTERNET , I'm LOVING IT :) Have a question! While accessing profile without login, How can we show Some message on top of Login Page like 'Login First' ?
@josephkubinski9118
@josephkubinski9118 3 жыл бұрын
If else! If authen the render Else, render normal login page and make an alert message
@gabrieludoudo2718
@gabrieludoudo2718 5 жыл бұрын
Thanks Sir for giving us the best Django videos on KZbin , Please can you do a video on how to upload audio file in django
@piacademy1991
@piacademy1991 3 жыл бұрын
Can you do a tutorial on how you learn all this stuff, That'd be real cool!!
@vladadidko3932
@vladadidko3932 6 жыл бұрын
Thank you, Corey! You're the best)
@boomnj127
@boomnj127 5 жыл бұрын
thank you for every thing. you are the best teacher
@sahilbisht3661
@sahilbisht3661 4 жыл бұрын
simply awesome thank you so much sir these videos helped me a lot love from India !!
@teddytalks499
@teddytalks499 4 жыл бұрын
Thanks Corey
@Raphael-bq1fc
@Raphael-bq1fc 2 жыл бұрын
Thank you very much! exactly what I was searching for; even more..
@ralphcaritativo2033
@ralphcaritativo2033 5 жыл бұрын
DONE TUTORIAL #7! Thank you SENPAI! :)
@jamatiasabirdfarming7760
@jamatiasabirdfarming7760 3 жыл бұрын
very easy and helpful series, thank you Corey.
@osamakhan5381
@osamakhan5381 5 жыл бұрын
Epic Tutorials, Keep up the good work
@sanjaydangwal2501
@sanjaydangwal2501 4 жыл бұрын
these tutorials are very helpful.
@adamtak3128
@adamtak3128 6 жыл бұрын
Question : How do you know what to import and where to import it from? That's the most confusing part of django to me. Thanks,
@coreyms
@coreyms 6 жыл бұрын
Hey there. You need to look in then documentation for that information. I have memorized certain imports, but constantly find myself in the documentation for others
@paulohsgoes1959
@paulohsgoes1959 4 жыл бұрын
Another great tutorial of yours. Congrats!
@gavinmurambadoro
@gavinmurambadoro 2 жыл бұрын
Django really compares well with Symfony Framework but I feel like it has a better developer experience. Thanks for this.
@suneelarumalla
@suneelarumalla 6 жыл бұрын
Nice videos,thanks for all your hard work
@md.soleymankhan6550
@md.soleymankhan6550 4 жыл бұрын
Best Django tutorial.
@saliksheraz6236
@saliksheraz6236 4 жыл бұрын
Great and helpful tutorials
@PrashantKumar-nb5ig
@PrashantKumar-nb5ig 4 жыл бұрын
Great Video sir
@xmuta
@xmuta 4 жыл бұрын
Great video tutorial
@shashanksharmadon4295
@shashanksharmadon4295 4 жыл бұрын
Awesome bro thanks best video ever.....
@patrickknows2296
@patrickknows2296 3 жыл бұрын
Corey deserve some 🍻
@MiguelSantos-dl4il
@MiguelSantos-dl4il 6 жыл бұрын
Hey Corey! Thank you for the great tutorials and your effort. I would like to ask a question: how do you remember which module to import?
@aminuolawale1843
@aminuolawale1843 4 жыл бұрын
It's not about remembering what module you ought to import at any stage of your coding. It's about what you actually need and where it is located. If you need your register view, it'd be located in your views.py so that is the module you would import.
@tpz1474
@tpz1474 4 жыл бұрын
@@aminuolawale1843 probably not the question that OP was asking. I'd think the question is about remembering the "django.contrib.auth.decorators" / "django.shortcuts" etc.
@akramnarejo6221
@akramnarejo6221 5 жыл бұрын
Corey you're amazing really a great blessing. thanks man.
@TUSHAR-mj1en
@TUSHAR-mj1en 3 жыл бұрын
Love from India Thank u BHAI
@sarunasj
@sarunasj 5 жыл бұрын
This is amazing. Simple and to the point. I'm now going to go back to Part 1. Thank you!
@petergames4819
@petergames4819 2 жыл бұрын
Love these tutorial videos! Thanks!
@juniormichaelseri5212
@juniormichaelseri5212 5 жыл бұрын
Fantastic tutorial!
@TRGIZATION
@TRGIZATION 3 жыл бұрын
Your videos are really helpful. Thank you
@najeebmoneeb
@najeebmoneeb 4 жыл бұрын
A very help full tutorial sir
@grouchydrago1396
@grouchydrago1396 4 жыл бұрын
thank god Django does all the hard stuff for me ;)
@SumanthLazarus
@SumanthLazarus 4 жыл бұрын
There is always a trade-off somewhere; I've learnt to understand this as a developer. As long as Django allows option customization, I'm content to use it.
@thiagonunes2751
@thiagonunes2751 2 жыл бұрын
Brilliant videos, congratulations!!!!
@heavylifter
@heavylifter 6 жыл бұрын
This is the very best tutorial I have ever seen in youtube! Thank you very much!!!! One question, is there a way to log in with email without customizing the user model?
@coreyms
@coreyms 6 жыл бұрын
You can find how to do that within the Django documentation, but it is a little complicated.
@jasongray4270
@jasongray4270 4 жыл бұрын
Good question, I was wondering the same. So I found the Django documentation and yes it is complicated. Is there an easier solution now?
@hasan8267
@hasan8267 5 жыл бұрын
Great tutorials! Thanks
@ahmad-ali14
@ahmad-ali14 5 жыл бұрын
this is the best toturial
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
How to write simple functions  - Uncle Bob
2:41
Dev Tools Made Simple
Рет қаралды 2 М.
Django Login Form and User Authentication
17:01
Dave Gray
Рет қаралды 20 М.
Login and Logout - Django Wednesdays ECommerce 7
20:33
Codemy.com
Рет қаралды 18 М.
Django Tutorial for Beginners - Build Powerful Backends
1:02:36
Programming with Mosh
Рет қаралды 2,8 МЛН
Python Login Program Tutorial - For Beginners
11:09
ShawCode
Рет қаралды 8 М.
Django QuickStart Web Application for Beginners
23:11
Python Simplified
Рет қаралды 90 М.
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН