Python Django Custom Authentication with Email Verification - Complete Project Tutorial

Ғылым және технология

In this step by step tutorial we’ll learn how to create an email verification system in Django from Scratch.
We will not use any external libraries or frameworks for authentication, instead we will create everything ourselves; we will make our own token generator, custom generator form, Activation email and view that checks the validity of the tokens and handles the activation status of user accounts and much much more. The goal is to provide a clear and comprehensive guide.
Throughout this tutorial, we'll cover essential aspects of the implementation; we will create our own token generator, custom generator form, activation email and views that checks the validity of the tokens and handles the activation status of user accounts and much much more. My goal when making this tutorial is to make the whole process as clear and complete as possible.
You can access and download the code file from my Patreon page:
/ pikocanfly
Chapters:
00:00 - What will do
00:22 - Create Directory
00:33 - Create Python .venv Environment
00:50 - Install Django
01:21 - start new django project + runserver + run migrations
Configure Email Settings:
02:25 - Create .env to keep environment variables - such as email address and password
03:07 - Install and use Python dot env (python-dotenv) to load environment variables
03:30 - Configure Django email settings for sending emails using the SMTP server
Token Generator:
5:40 - Create tokens.py
5:54 - Define Token Generator Function that inherits from PasswordResetTokenGenerator
Registration Form:
07:11 - Create forms.py
08:13 - Define Class Registration form that inherits from Django’s UserCreationForm
Views:
09:47 - Create views.py
09:58 - Define Registration View that has logic for email message including sending the verification email
16:53 - Define Index view
17:38 - Define Activate View + logic to decode token and activate users
URLS
21:55 - define URL patterns
Templates:
23:40 - Create templates dir + add path in settings.py
24:45 - create base-template file + Add HTML boilerplate
28:31 - Create Register template followed by Login template
30:15 - Activation Email Template
31:49 - Redirect to index upon Login
32:16 - Add Path to Static Directory in settings.py
34:09 - Add CSS styling
34:58 - Style message according to tag
#Python #Django #tutorial #authentication #email #verification

Пікірлер: 36

  • @PikoCanFly
    @PikoCanFly4 ай бұрын

    Hey! I have been extremely busy this week so it took me longer than I initially expected to find the time to create this video. Nonetheless I had so much fun creating it. Let me know what you think! 😊

  • @K8LOYT

    @K8LOYT

    4 ай бұрын

    wow thank you so much, I know I request this ☺

  • @PikoCanFly

    @PikoCanFly

    4 ай бұрын

    @@K8LOYT You are very welcome. I hope you find it useful! 😊

  • @K8LOYT

    @K8LOYT

    4 ай бұрын

    very usefull that encrypt and decrypt part most usefull and logic behind handling such situations. @@PikoCanFly

  • @user-ro6pz2eg5o
    @user-ro6pz2eg5o4 ай бұрын

    Amazing work! I love that you took the time to explain everything in detail. I found it extremely useful especially thar you explain the token generator and how to decode, I have been searching for this for a long time. You are a life saver.

  • @PikoCanFly

    @PikoCanFly

    4 ай бұрын

    Awesome, thank you!

  • @kylec.5476
    @kylec.5476Ай бұрын

    this was actually quite helpful. thanks!

  • @Studio-dy9kh
    @Studio-dy9khАй бұрын

    Great work! Thank you!!!!!! Now you've got a new subscriber!

  • @HAverroes
    @HAverroes4 ай бұрын

    You did it again! Awesome Tutorial 👏👏

  • @PikoCanFly

    @PikoCanFly

    4 ай бұрын

    Glad you like it! 🥰

  • @user-np9xh4fr5o
    @user-np9xh4fr5o3 ай бұрын

    Very nicely explained! Thank you!

  • @PikoCanFly

    @PikoCanFly

    3 ай бұрын

    You're very welcome!

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

    Amazing video!, super helpful and well explained

  • @PikoCanFly

    @PikoCanFly

    Ай бұрын

    Thank you so very much! 😊

  • @AkeabMesfin
    @AkeabMesfin2 ай бұрын

    thanks! very much you dont know how much this video saved me!

  • @PikoCanFly

    @PikoCanFly

    2 ай бұрын

    I am so happy to hear it helped. 😀

  • @user-ww3dz4ow7g
    @user-ww3dz4ow7g3 ай бұрын

    Thanks and greetings from Chile.

  • @PikoCanFly

    @PikoCanFly

    3 ай бұрын

    Con gusto! 😊

  • @M.I.S
    @M.I.S2 ай бұрын

    very GOOd!

  • @M.I.S
    @M.I.S2 ай бұрын

    thanks!

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

    Thanks a lot

  • @PikoCanFly

    @PikoCanFly

    3 ай бұрын

    Most welcome!

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

    Hey ms.Piko please go a head to create django playlist and your voice is damn cool and i think you attracting leaners with your voice

  • @markogles3483
    @markogles34832 ай бұрын

    I'm getting an Exception Value: super() argument 1 must be a type, not str when registering a user. Can you help?

  • @PikoCanFly

    @PikoCanFly

    2 ай бұрын

    Hi, if I were you I would recheck my super() call in forms.py If you have followed the tutorial, it should look like this: user=super(RegistrationForm, self).save(commit=False) I hope that helps :)

  • @markogles3483

    @markogles3483

    2 ай бұрын

    I apologize . I should have sent the exception location in the first email.

  • @CheesyFuture
    @CheesyFuture4 ай бұрын

    Probably it would be better to create all of that inside an app instead on the main project, wouldn't it??

  • @PikoCanFly

    @PikoCanFly

    4 ай бұрын

    It depends on your project structure and use case.

  • @stockmarketwithab7381
    @stockmarketwithab73813 ай бұрын

    hey do you know wagtail csm ??

  • @PikoCanFly

    @PikoCanFly

    3 ай бұрын

    Yes

  • @stockmarketwithab7381

    @stockmarketwithab7381

    3 ай бұрын

    wow can you plase make tutorial of that if you have free time @@PikoCanFly

  • @stockmarketwithab7381

    @stockmarketwithab7381

    3 ай бұрын

    can you please make tutorial on wagtail if you are free from start@@PikoCanFly

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

    Hello, thanks for the awesome video. I am getting an error during template rendering when i try to register a user. django.urls.exceptions.NoReverseMatch: Reverse for 'activate' with keyword arguments '{'uidb64': '', 'token': 'c63f4k-9513de088b89a2ed3c0e462dad785146'}' not found. Any advice on how to fix this? Thank you

  • @PikoCanFly

    @PikoCanFly

    Ай бұрын

    Hello, Try to double-check that the values you're passing for uidb64 and token are correct and valid. It seems like the uidb64 value is empty in your error message, which might indicate an issue with generating or passing this value. I hope that helps. :)

Келесі