User registration and authentication in Django

Handle user registration and authentication in Django
⚡️ Important links:
code.visualstudio.com/download
github.com/cloud-with-django/...
🪧 Video timestamps:
00:00 - Intro
00:07 - Setup our Django project
06:56 - Setup our Django app
8:36 - Configure our URL's, Views and Templates
25:19 - User registration
40:25 - User authentication
50:51 - User logout
53:42 - Protecting our views
56:31 - Final demonstration
🧑‍🏫 Courses:
www.cloudwithdjango.com/courses
💫 Become a Cloud With Django member (30% course discounts):
/ @cloudwithdjango
🐦 Twitter:
/ cloudwdjango
⭐️ Github:
github.com/cloud-with-django
📢 Coaching:
www.cloudwithdjango.com/coach...
📑 Blog:
www.cloudwithdjango.com/blog/
❤️ Support:
www.paypal.com/donate/?hosted...

Пікірлер: 86

  • @hp7734
    @hp773411 ай бұрын

    Outstanding content, as always!! Thank you.⭐⭐⭐

  • @Tcrrxzz
    @Tcrrxzz5 ай бұрын

    I may not often watch this guy's content, but this was ABSOLUTELY AMAZING and UNDERSTANDABLE!!!

  • @CloudWithDjango

    @CloudWithDjango

    5 ай бұрын

    Thank you so much! I really appreciate your comment! I'm glad that you enjoyed the content! All the best to you! :)

  • @bannisterrb
    @bannisterrbАй бұрын

    Very clean work! Your pacing throughout this video was perfect - no pauses to shill products or promote sponsors. Excellent.

  • @CloudWithDjango

    @CloudWithDjango

    Ай бұрын

    Thank you so much! I appreciate your support!

  • @cambium0
    @cambium04 ай бұрын

    Flask yesterday, and after this vid (and a few other resources), Django today. Great tutorial.

  • @CloudWithDjango

    @CloudWithDjango

    4 ай бұрын

    Thank you!

  • @user-kr8zm2rj4y
    @user-kr8zm2rj4y2 ай бұрын

    Thank you for taking the time to create such great content. I really learn from you! Keep up with the great work.

  • @CloudWithDjango

    @CloudWithDjango

    2 ай бұрын

    Thank you so much for your kind words. I'm glad that you are enjoying the content! All the best to you!

  • @user-yp2zl7sp5y
    @user-yp2zl7sp5y2 ай бұрын

    It was so easy to learn from your tutorial. Perfect for beginners. I was able to follow your steps in login and authentication. I would loved to watch your tutorials.

  • @CloudWithDjango

    @CloudWithDjango

    2 ай бұрын

    Thank you so much! I'm glad that it was helpful and easy to follow!

  • @darshilkumar7816
    @darshilkumar78166 ай бұрын

    Thank you so much , its really underrated channel

  • @CloudWithDjango

    @CloudWithDjango

    6 ай бұрын

    My pleasure! Ah, thank you so much, I really appreciate your comment!

  • @darshilkumar7816

    @darshilkumar7816

    6 ай бұрын

    @@CloudWithDjango just a doubt, how can I make it so that whenever a new user registers it .. a verification mail is sent to the mail filled in the form for authentication and then the user is marked as active... Can you make a video on it??

  • @arel5309
    @arel53094 ай бұрын

    You are STAR for IT 🎉 This video will be popular 👋

  • @CloudWithDjango

    @CloudWithDjango

    4 ай бұрын

    Thank you so much!

  • @arel5309
    @arel53094 ай бұрын

    You are genius THANK YOU I WILL SHARE

  • @CloudWithDjango

    @CloudWithDjango

    4 ай бұрын

    Thank you! I appreciate the support!

  • @navidfalahatchian5373
    @navidfalahatchian53732 ай бұрын

    Thank you dude. super useful

  • @CloudWithDjango

    @CloudWithDjango

    2 ай бұрын

    My pleasure! I'm glad that it was useful for you!

  • @indranipudaruth9341
    @indranipudaruth93415 ай бұрын

    excellent, and thanks.

  • @CloudWithDjango

    @CloudWithDjango

    5 ай бұрын

    My pleasure! :)

  • @omshukla1211
    @omshukla12114 ай бұрын

    Thanks a lot man!!! You are a saver

  • @CloudWithDjango

    @CloudWithDjango

    4 ай бұрын

    My pleasure! :)

  • @syamagopalj3601
    @syamagopalj36014 ай бұрын

    Great tutorial for beginners

  • @CloudWithDjango

    @CloudWithDjango

    4 ай бұрын

    Thank you so much!

  • @itshero5684
    @itshero568411 ай бұрын

    Amazing tutorial

  • @CloudWithDjango

    @CloudWithDjango

    11 ай бұрын

    Thank you!

  • @user-cr1dh9fw4q
    @user-cr1dh9fw4qАй бұрын

    Thanks! very useful

  • @CloudWithDjango

    @CloudWithDjango

    Ай бұрын

    My pleasure! I'm glad that it helped!

  • @Zinab8850
    @Zinab88504 ай бұрын

    Thank you so much♥♥

  • @CloudWithDjango

    @CloudWithDjango

    4 ай бұрын

    My pleasure!

  • @shadrack3370
    @shadrack33705 ай бұрын

    thanks a lot . you just helped me a lot. hey do you have any video for django shopping cart project

  • @CloudWithDjango

    @CloudWithDjango

    5 ай бұрын

    My pleasure! I'm glad that this video helped you. Unfortunately, I don't have a video for a django shopping cart project.

  • @thekingsproduction8897
    @thekingsproduction88977 ай бұрын

    Nice tutorial. Can you please create a tutorial on role based and permissions based on authentication.

  • @CloudWithDjango

    @CloudWithDjango

    7 ай бұрын

    Thank you for your feedback and suggestion

  • @inteliconn995
    @inteliconn99511 ай бұрын

    Thanks!

  • @CloudWithDjango

    @CloudWithDjango

    11 ай бұрын

    You're welcome! :)

  • @saudalruwili-ck2zr
    @saudalruwili-ck2zr12 күн бұрын

    thank you a lot

  • @CloudWithDjango

    @CloudWithDjango

    12 күн бұрын

    My pleasure!

  • @FlutterPythoncombo
    @FlutterPythoncombo11 ай бұрын

    That was amazing Tutrial thank you very much! Can you do a tutorial on Django-Alluth (Google Sign in ) as well, the problem with all the tutorials on KZread is they just talk about the setup but nothing in Depeth, Esp , View, and Template of Django Alluth , cheers

  • @CloudWithDjango

    @CloudWithDjango

    11 ай бұрын

    My pleasure! I appreciate the feedback. Thank you for the good suggestion and for providing context.

  • @selciVlogs
    @selciVlogs7 ай бұрын

    Super🎉

  • @CloudWithDjango

    @CloudWithDjango

    7 ай бұрын

    Thank you!

  • @skalearners
    @skalearners3 ай бұрын

    Good content

  • @CloudWithDjango

    @CloudWithDjango

    3 ай бұрын

    Thank you!

  • @andredicarlo3310
    @andredicarlo33103 ай бұрын

    This worked great, thanks! One thing though, how would you protect your view (via the @login-required decorator) if you're using a class based view for your Dashboard page? I can only get it to work on function based views, not class-based, which seems a significant limitation. If anyone knows please enlighten me.

  • @CloudWithDjango

    @CloudWithDjango

    3 ай бұрын

    Thank you!! To protect a class-based view with the @login_required decorator in Django, you can use the LoginRequiredMixin provided by django.contrib.auth.mixins. Simply inherit from this mixin in your class-based view definition to ensure that only authenticated users can access the view.

  • @Gleb_Pastushenko
    @Gleb_Pastushenko5 ай бұрын

    Hello! At 47:50 I can't understand one confusing thing - why a dot notation auth.login() is used, since you have already imported the login() function as is?

  • @CloudWithDjango

    @CloudWithDjango

    5 ай бұрын

    Hi, That's a good question. You are right, it's not necessary, just a developer preference.

  • @AllistairLee
    @AllistairLee11 ай бұрын

    Great tutorial. What about when users are authenticated using 3rd party services (Azure AD for example)? How do you integrate that with Django user model so that you can assign them to different user groups within Django?

  • @CloudWithDjango

    @CloudWithDjango

    11 ай бұрын

    Hi Allistair, Thank you for your feedback and question. I believe that would be quite a challenge, but generally speaking if you want to add in a 3rd party service. You would need to use the following package: django-allauth.readthedocs.io/en/latest/ The above package is specifically used for 3rd party integration. However it is more geared towards social authentication. If we are talking more specific about Azure AD. I would suggest looking at the below docs and packages for more clarity: django-auth-adfs.readthedocs.io/en/latest/azure_ad_config_guide.html pypi.org/project/django-azure-active-directory-signin/ Good luck!

  • @Ahmed-gz7zq
    @Ahmed-gz7zq11 ай бұрын

    great content again, does it is a correct way to implement allauth for this chapter or it will be more un effiecient way?

  • @CloudWithDjango

    @CloudWithDjango

    11 ай бұрын

    Thank you Ahmed! :) It will really depend. There aren't exactly right or wrong ways when it comes to authentication. The question that you should ask yourself is - what do I really need and does it do the job for me?

  • @Ahmed-gz7zq

    @Ahmed-gz7zq

    11 ай бұрын

    @@CloudWithDjango thank you very much, when I get a job I'll mention that I learned a lot from you ❤️❤️

  • @CloudWithDjango

    @CloudWithDjango

    11 ай бұрын

    My pleasure! Oh thank you so much! That is very very kind of you, but you don't need do that! That being said, I really appreciate all the support! It is deeply appreciated! All the best!

  • @yamashita8822
    @yamashita88225 ай бұрын

    Please please please create a pdf of how you create your django projects step by step, that would be highly appreciated.❤🎉

  • @CloudWithDjango

    @CloudWithDjango

    5 ай бұрын

    Thank you for your suggestion!

  • @sidds09
    @sidds0911 ай бұрын

    can you also do role based and permissions based authentication.

  • @CloudWithDjango

    @CloudWithDjango

    11 ай бұрын

    Thank you for the suggestion!

  • @vedantmayekar2171
    @vedantmayekar21713 ай бұрын

    How do I get the Login/Register page first when I launch the server instead of the homepage?

  • @CloudWithDjango

    @CloudWithDjango

    3 ай бұрын

    Hi, You would need to set the login/register page as the default url with empty strings in the route name as we do the homepage. You can swap around the urls to set the login/register page

  • @nandu.kallur
    @nandu.kallur5 ай бұрын

    Pls can you do a tutorial series on django rest framework?

  • @CloudWithDjango

    @CloudWithDjango

    5 ай бұрын

    Thank you for the suggestion!

  • @lamba_44
    @lamba_4410 ай бұрын

    How do I use the email authentication (one of your previous videos) with this video's registration and authentication?

  • @CloudWithDjango

    @CloudWithDjango

    10 ай бұрын

    Hi, I would suggest following the docs of the module that is utilized in the email authentication tutorial.

  • @ramerlacida4737
    @ramerlacida47375 ай бұрын

    its nice but how about the looks of the form, like beautify it =) do you have any guide?

  • @CloudWithDjango

    @CloudWithDjango

    5 ай бұрын

    Hi, Thank you! Yes, you would need to use crispy forms and bootstrap.

  • @ASTRALABSGH
    @ASTRALABSGH13 күн бұрын

    do video for user registration and otp authentication

  • @CloudWithDjango

    @CloudWithDjango

    13 күн бұрын

    Thank you for your suggestion!

  • @9r..visualtreat958
    @9r..visualtreat9586 ай бұрын

    Dude. I use the Usercreationform, step by step by watching your video but it didn't display the email form.

  • @CloudWithDjango

    @CloudWithDjango

    6 ай бұрын

    Hi, I'd suggest double checking the GitHub source code.

  • @briangreenberg153
    @briangreenberg1532 ай бұрын

    Let's say the URL is trying to take me to a page called /summary_report/ but that view for that page is protected using the login_required decorator. I am correctly sent to the login page. However, after logging in, I want to be redirected to the /summary_report/ page where I was originally trying to go. I don't want to be directed to the dashboard Do you have a solution for that? Thanks!

  • @CloudWithDjango

    @CloudWithDjango

    2 ай бұрын

    Hi, So what you can do is this: Ensure your login URL includes a next parameter that holds the original page's URL. On the login page, capture this parameter in a hidden input field within the login form. In your login view, after successful authentication, check for the next parameter. If it exists, redirect the user to that URL; otherwise, redirect them to a fallback option like the dashboard. This approach ensures users are redirected back to the original page they intended to access after logging in. Hopefully that gives you some more insight! Good luck!

  • @briangreenberg153

    @briangreenberg153

    2 ай бұрын

    @@CloudWithDjango Thank you. I will give it a try! OK, I tried it and it works! Thanks for the great suggestion.

  • @CloudWithDjango

    @CloudWithDjango

    2 ай бұрын

    No worries! Of course, it's my pleasure! Glad it worked for you!

  • @arel5309
    @arel53094 ай бұрын

    Can you create video Confirmation by mail at registration😅😁👋

  • @CloudWithDjango

    @CloudWithDjango

    4 ай бұрын

    Thank you for the suggestion!

  • @jhalmu
    @jhalmu7 ай бұрын

    So this handles automatically crypting and decrypting passwords?

  • @CloudWithDjango

    @CloudWithDjango

    7 ай бұрын

    Hi, Yes, Django by default hashes your password with it's selected encryption scheme

  • @jhalmu

    @jhalmu

    7 ай бұрын

    @@CloudWithDjango That's convinient.

  • @CloudWithDjango

    @CloudWithDjango

    7 ай бұрын

    Yes, hence removing the trouble of having to do it ourselves :)