How to Create a Login System in Python Using Django? | Python Projects | GeeksforGeeks

Поділитися
Вставка
  • Опубліковано 6 лип 2021
  • In this video, we're going to discuss how to create a Login System in Python using Django. In this web application, the user will be able to register on the website, and then the user will also receive a confirmation email in order to activate his/her account. After that, the user can log in to the system at any time. So, let's get started now.
    💻 For Complete Code: media.geeksforgeeks.org/wp-co...
    📑 Django Sign Up and Log in with confirmation Email [Article]: www.geeksforgeeks.org/django-...
    -------------------------------------------------------------------------
    🔴 Data Science Projects made easy with Colab AI: • DATA SCIENCE PROJECTS ...
    🔴 Python Projects Playlist: • Top Python Projects fo...
    🔴 Machine Learning Playlist: • Machine Learning Projects
    🔴 Frontend Projects Tutorials: • Frontend Projects Tuto...
    🔴 C++ vs Java vs Python: • C++ vs JAVA vs PYTHON ...
    -------------------------------------------------------------------------
    📚 Explore Our Courses: practice.geeksforgeeks.org/co...
    -------------------------------------------------------------------------
    Follow us for more fun, knowledge, and resources:
    💬 Twitter- / geeksforgeeks
    🧑‍💼 LinkedIn- / geeksforgeeks
    📷 Instagram- geeks_for_g...
    💌 Telegram- t.me/s/geeksforgeeks_official
    📱 Download GeeksforGeeks' Official App: geeksforgeeksapp.page.link/gf...
    Related Queries:
    login system project
    login system using python
    python projects
    django projects
    login in system using django
    django tutorials
    python project tutorials
    #django #loginsystem #python #pythonprojects #djangoprojects #djangotutorial #geeksforgeeks #gfg #pythontutorial

КОМЕНТАРІ • 420

  • @GeeksforGeeksVideos
    @GeeksforGeeksVideos  7 місяців тому +5

    For more such Projects check out our Playlist: ua-cam.com/play/PLqM7alHXFySExPLJSzpKfKe6JO44Qm0qj.html&si=Tpg_3fu2oZI19FA7

  • @GeeksforGeeksVideos
    @GeeksforGeeksVideos  3 роки тому +26

    Apply For Video Internship Program - script.geeksforgeeks.org/on-boarding/youtube

    • @HarpreetKaur-ph3sw
      @HarpreetKaur-ph3sw 2 роки тому

      i hv query

    • @madathalanithinreddy4594
      @madathalanithinreddy4594 Рік тому

      I have a problem?, when we are adding app name it’s showing no such file or directory, can u help me with this problem

    • @26avishkarbhoir85
      @26avishkarbhoir85 Рік тому

      @@madathalanithinreddy4594 iam facing same problem can antibody tell me please it's urgent

    • @gkgdomain9767
      @gkgdomain9767 Рік тому

      hello
      ive tried many times but am not getting any confirmation mail.
      please help me out.

    • @muzamilimran7712
      @muzamilimran7712 Рік тому

      bhai hindi ma ya urdu ma bnaya kar
      videos

  • @pg2273
    @pg2273 2 роки тому +31

    13:11 Very well explained
    23:57 35:51 Must
    45:51 Gmail verification

  • @TheMrchement
    @TheMrchement Рік тому +6

    Finally someone made a python tutorial, I've been looking for it for a long time, thanks brother

  • @aayusharmaah
    @aayusharmaah 3 роки тому +24

    Wow! This was very helpful, thank you for this video ❤️

  • @metricfruit
    @metricfruit 2 роки тому +6

    Dude your "left-click + alt" key shortcut is a game changer (and I thought the video itself was already great -- this is the cherry on top!)

  • @KaranArora7
    @KaranArora7 3 місяці тому

    Whenever I refresh my page after signing in, it shows csrf error. Bit I have already added that csrf code in my html. Please tell me what to do? 45:32

  • @krishpatel_2383
    @krishpatel_2383 Рік тому +3

    great tutorial.
    Everything is well explained.
    My sincere thank you to gfg and Anubhav Madhav.

  • @Tony-pk1vb
    @Tony-pk1vb 2 роки тому +71

    Just for info, force_text has been depreciated in django 4, instead use force_str

    • @AnubhavMadhav
      @AnubhavMadhav 2 роки тому +1

      Yes, thanks!

    • @notchippy
      @notchippy 2 роки тому +1

      what about this one SMTPAuthenticationError at /signup

    • @fazilasayed375
      @fazilasayed375 Рік тому +1

      so where all do we have to make the changes?

  • @Ranji544
    @Ranji544 8 місяців тому +4

    Sir please mention the extensions you have used in VS Code for this video. I am not getting some code suggestions for import statements in django in quick fix

  • @thecanadian6145
    @thecanadian6145 5 місяців тому +2

    Dude's a pro at entering his details

  • @nikhileshshah361
    @nikhileshshah361 2 роки тому +2

    instead of taking last name if I want to take age,city as the input how can I store it into same table

  • @dineshbabujalla
    @dineshbabujalla 2 роки тому +30

    Excellent explanation brother,
    well understood,
    and i successfully completed my first project as a beginner with your help
    My sincere thanks to,
    GeeksforGeeks
    and Anubhav brother
    for nice explanation..

    • @AnubhavMadhav
      @AnubhavMadhav 2 роки тому +2

      Thank you so much bro! Happy to help 💖

    • @victorynwokejiobi1762
      @victorynwokejiobi1762 Рік тому

      Please let's link up via email. So you can put me through. I'm facing some challenges on my sign up page

    • @kohlintr7180
      @kohlintr7180 2 місяці тому

      I got an error at signup page,could you send reply to my msg

  • @taherkatwara3922
    @taherkatwara3922 Рік тому

    How about if enter a different email id from this video, does the app will send confirmation email as if you have given your email id in the code?

  • @daniellacardenas2920
    @daniellacardenas2920 Рік тому

    when i click on sign in or sign up buttons i am not taken to the right page. instead of being taken to the signin page after completing the signup form, i am just taken to a page that reads: "Your file couldn't be accessed," and the file directory is C:/signup. what am i doing wrong?

  • @shreyash462
    @shreyash462 6 місяців тому +3

    Simple and Concise , props gfg !

  • @krupaldudhat3605
    @krupaldudhat3605 Рік тому +1

    After the signup page i am getting redirected to the same page rather than going to the signin page, even after using "return redirect('home')" and every other things things are same as he did..Any solutions please??

  • @fieckka8104
    @fieckka8104 Рік тому

    how to automate html tags in django framework,
    when i install django extension, my html tags are not automatic, how to fix?

  • @kenkioqqo
    @kenkioqqo Рік тому +2

    Anubhav Madhav, you are the man! This is the best Django Authentication tutorial I've come across anywhere. The only one that has worked for me. I can't thank you enough ma man. Blessings!

    • @AnubhavMadhav
      @AnubhavMadhav 10 місяців тому

      Thanks man, and you're welcome!

    • @harshrajyoutube
      @harshrajyoutube 5 місяців тому

      Bro it showing cannot import name ' force_text' from 'Django.utils.encoding'😢

  • @manthanghasadiya
    @manthanghasadiya 3 роки тому +2

    Amazing video. Waiting for more videos like this 😀

  • @nayonikaarora5039
    @nayonikaarora5039 2 роки тому

    Can you tell why its showing you are seeing this page because DEBUG=True is in your settings file and you have not configured any URLs

  • @leomaredcampos4941
    @leomaredcampos4941 6 місяців тому

    This is my question not.
    I already made a web where the client can input data.
    so, is it not part of front end?

  • @njcoder2641
    @njcoder2641 Рік тому

    I have a doubt at 40:59 when we are writing div inside index.html and in that div we are adding classes so my doubt is how are these classes work bcoz in my program the messages isn't closing please help

  • @TanujKalraVlogs
    @TanujKalraVlogs 2 роки тому +30

    9:36
    To avoid copying files back to main gfg folder.
    Give django-admin startproject gfg . (after project name give a space and dot(.)). it will create only one folder with all files.

    • @AnubhavMadhav
      @AnubhavMadhav 2 роки тому +1

      Yes💯

    • @laraibkhan2517
      @laraibkhan2517 2 роки тому +1

      That I always use😁

    • @oviemennu169
      @oviemennu169 2 роки тому

      i keep getting this error when i try to run ''ModuleNotFoundError: No module named 'gfg.settings''
      can anyone help me with resolving this error?

  • @nouhailadkiouak6371
    @nouhailadkiouak6371 Рік тому +2

    Well explained! Thank you so much !

  • @dhruvshah7952
    @dhruvshah7952 2 роки тому

    Hello could you explain how I would create unit tests for the login page? any helpful links or resources please let me know thanks

  • @laxmidevi-wm1ep
    @laxmidevi-wm1ep Рік тому

    could you please tell us how to Create a panel to upload a JSON file (shared separately) add validations for the type of
    file

  • @beatester8528
    @beatester8528 2 роки тому +2

    i got integrity error /signup bro . what can I do for this .please rply bro.

  • @rickaridi
    @rickaridi 9 місяців тому

    Can the Django Authentication library be replaced with and external authentication service?

  • @balamurali6698
    @balamurali6698 4 місяці тому

    Hey, Anubhav I want to know how to create local host and admin page for my own project already written, I can't run my project in local host can u explain for this???

  • @prajwalpgowda7826
    @prajwalpgowda7826 Рік тому +3

    Gmail has removed less secure app access... What to do to complete this task?

  • @hypermax3964
    @hypermax3964 Рік тому

    is there any way to use edit and delete function through the html page

  • @efs1223
    @efs1223 10 місяців тому

    can someone help me? I've tried dozens of migrations and retried the video where it first try if the page is working but all I get is this message "The install worked successfully! Congratulations!
    You are seeing this page because DEBUG=True is in your settings file and you have not configured any URLs." and dont see any changes even though I updated it, help

  • @oviemennu169
    @oviemennu169 2 роки тому

    i keep getting this error ModuleNotFoundError: No module named 'gfg.settings'
    can anyone help me with resolving this error?

  • @mohitklamba
    @mohitklamba 3 роки тому +3

    Great video, really great efforts

  • @adeniyiladenegan7450
    @adeniyiladenegan7450 2 роки тому +10

    Amazing job...I need you to know what you already know, "People like you are simply Blessing to humanity"
    Gonna be watching again. THANK YOU!!

    • @AnubhavMadhav
      @AnubhavMadhav 2 роки тому +1

      Thank you so much ❤️ It means a lot ✨

  • @mrsjain1419
    @mrsjain1419 2 роки тому

    Sir i am getting an error broken pipe , can u help on the signnup button

  • @zend969
    @zend969 11 місяців тому

    am getting this error while using Django v 4 : Reverse for 'activate' with keyword arguments '{'uidb64': '', 'token': ''}' not found. 1 pattern(s) tried: ['activate/(?P[^/]+)/(?P[^/]+)\\Z']. please any work around to this Error

  • @pradyumnpandey1148
    @pradyumnpandey1148 2 роки тому +1

    can anyone tell how to setup djang admin page where we can see update of all the users?

  • @adnank7496
    @adnank7496 Рік тому +1

    Very helpful video. Thanks

  • @michaelwarner5277
    @michaelwarner5277 Рік тому +7

    Very excellent tutorial. This is extremely thorough.

  • @leocodeio
    @leocodeio 5 місяців тому

    hello please help:
    when i at 39:20
    at the time of sign in even i hve entered the correct credentials i am getting user as none please help

  • @manaalsandeepparikh2593
    @manaalsandeepparikh2593 3 роки тому +2

    Amazing Video and easy to understand!

  • @hamzaimran973
    @hamzaimran973 2 роки тому +2

    Sir the email is not being sent for verification when i signup

  • @smarter_by_bit9346
    @smarter_by_bit9346 3 роки тому +3

    Django is getting more and more famous damn fast.

  • @mjgaming4322
    @mjgaming4322 Рік тому

    I got an error as Integrity error "Not Null constraint failed: auth_user.password"
    Please give me solution

  • @gopirajuvelpula3832
    @gopirajuvelpula3832 Рік тому

    not redirected to my signin page..even i return redirect('signin')..what is the solution

  • @adityakanodia8319
    @adityakanodia8319 2 роки тому

    the given username must be set
    getting this error, how can I fix it?

  • @gkgdomain9767
    @gkgdomain9767 Рік тому

    hello
    ive tried many times but am not getting any confirmation mail.
    please help me out.

  • @nishupareek6073
    @nishupareek6073 Рік тому

    Can you help me, coz csrf_token is not working on my vs code

  • @ahirshiv2484
    @ahirshiv2484 Рік тому

    in my google account less secure app Not showing that buttan of turn on and off what to do sir

  • @fadalrazin6696
    @fadalrazin6696 8 місяців тому +1

    Couldn't send mail to users. Less secure apps is unable to ON. Anyone got any better ideas?

  • @xanos3826
    @xanos3826 2 роки тому +7

    Yo, I love the way you explained everything 🎉☄️. This video really helped me 💪

    • @AnubhavMadhav
      @AnubhavMadhav Рік тому +3

      Thank you bro, glad to help!✨

    • @ayenidanielibikunle
      @ayenidanielibikunle Рік тому

      @@AnubhavMadhav
      Hello Mr Anubhav,
      Thank you very much for such an amazing tutorial.
      Please I have a question in the sign view function. How did you call the "user.first_name" in the function when we didn't clearly get the details in the form from the user?

  • @NainaShukla-nq6um
    @NainaShukla-nq6um 3 місяці тому +3

    Thank you so much sir 😭💖💖

  • @timur_kotelnikov
    @timur_kotelnikov Рік тому +1

    Awesome! Thanks a lot 🔥

  • @manishchavhan5278
    @manishchavhan5278 2 роки тому

    how can i open pycharm by command promt as u opened code

  • @user-sc1fr3up4j
    @user-sc1fr3up4j 11 місяців тому +1

    Perfect voice perfect step by step explanation no mixing clear idea Thank you so much sir👍

    • @mohan_chandraa
      @mohan_chandraa 9 місяців тому +1

      ​@@AnubhavMadhav
      Hello bro!!
      Less secure apps is no longer working, Is there any alternative?

  • @amarnikam1387
    @amarnikam1387 Рік тому

    While makemigations it shows no changes detected. please help

  • @aryanpatel8140
    @aryanpatel8140 Рік тому

    So I made the project in my pc but now I want to run this code in my friend's pc so what to do and how to run

  • @adityapratapsinghbhadoria222
    @adityapratapsinghbhadoria222 2 роки тому

    i did everything same but unable to get any mail yet it load and the succesfully register account but i get no mail

  • @rushijaviya7691
    @rushijaviya7691 2 роки тому +1

    Very helpful!

  • @RifatShaheb
    @RifatShaheb 2 роки тому

    31:00 my signup button isnt working. it says "The view authentication.views.signup didn't return an HttpResponse object. It returned None instead."
    what am i supposed to do now! :(

  • @PAPAHAI909
    @PAPAHAI909 7 місяців тому

    What about wrong credentials during login. If we enter wrong credentials then also user is getting login automatically

  • @DARKKNIGHT-qe5bm
    @DARKKNIGHT-qe5bm 2 роки тому +22

    google removed less secure apps function, now how to do the email verification?

    • @rexmatrix1208
      @rexmatrix1208 8 місяців тому

      Sir u found any way

    • @lalitagarwal9155
      @lalitagarwal9155 8 місяців тому +4

      Just enable 2 factor authentication in your Google account and after enabling you will get an option of creating app. Now create a app with any name you like and after that you will get 16 characters password just copy it and paste it in the code(WITHOUT SPACE).

    • @explorewithlainey3935
      @explorewithlainey3935 6 місяців тому +1

      ​@@lalitagarwal9155hey,I don't see the 'create app' nor the code you are referring to, after enabling the 2-step verification

    • @lalitagarwal9155
      @lalitagarwal9155 6 місяців тому

      @@explorewithlainey3935 inside 2 step verification section you will see "App passwords" option just down below of the page.
      Just click and make a new app with your preferred name. After this you will get password that's it.

    • @lalitagarwal9155
      @lalitagarwal9155 6 місяців тому +1

      @@explorewithlainey3935 it worked or not please specify so that I can help further..

  • @user72386
    @user72386 Рік тому +1

    Thank you my friend, works very fine

  • @rickaridi
    @rickaridi 9 місяців тому +1

    Thank you for the great video by the way.

  • @aksharbhalani8331
    @aksharbhalani8331 2 роки тому +1

    Amazing video bro

  • @robotectamani
    @robotectamani 2 роки тому +1

    Thanks alot Man IM enjoying watching this Great work to Geeks For Geeks

  • @deeptisharma8645
    @deeptisharma8645 Рік тому +1

    I am not getting any email after signing up.
    I did all the steps as shown by you.
    Can you help me...

  • @sree0597
    @sree0597 8 місяців тому

    The problem is that Google stopped services for less secure apps so I am unable to generate the email and send

  • @kieranstuthridge2932
    @kieranstuthridge2932 Рік тому +3

    Hi, my html files are not saved as django files as shown in the video & this doesn't allow me to include the csrf_token. How do i fix this?

  • @skills_set
    @skills_set 9 місяців тому +1

    thanks much, this saved my day

  • @deepshah2305
    @deepshah2305 3 роки тому +2

    Amazing 🤩

  • @sanket2586
    @sanket2586 2 роки тому

    when we enter wrong data in sign-in page, it's show bad credentials and also show logged in successfully
    and only show the signout button, not signin or signup button............

  • @engr.nwaohas.o2720
    @engr.nwaohas.o2720 2 роки тому +1

    This is great. you really did a nice work

  • @77N776
    @77N776 2 роки тому +1

    Thanks for the great explanation.👍👍👍

  • @parthib_deb23
    @parthib_deb23 Рік тому

    very excellent video but one addition to this video is that , template inheritance may be applied for better html handling thought here frontend is not main to teach!!

  • @20archy
    @20archy Рік тому

    Hi! I am seeing a message stating as "UNIQUE constraint failed: auth_user.username" while clicking the "Sign Up" button (of course, after filling up the respective fields). Can anyone help?

    • @sparrowsurya96
      @sparrowsurya96 Рік тому

      the user has been already created in database

  • @varunsu167
    @varunsu167 Рік тому

    Please give me insight as to how i should integrate it with my Machine Learning Model?

  • @haroldquek1655
    @haroldquek1655 Рік тому

    would you be making a video tutorial using JWT cookies and incorporating with mongoDB?

  • @StatusWorld-sl1lu
    @StatusWorld-sl1lu 7 місяців тому

    i have tried this code also my website is working but i dont get the confirmation email i dont know whats the problem can u solve it for me

  • @mukeshgaur4263
    @mukeshgaur4263 2 роки тому +1

    best lecture for the django login with database and gmail confimation thankyou

    • @AnubhavMadhav
      @AnubhavMadhav 2 роки тому

      Thank you Mukesh! ✨

    • @AP-qg9ss
      @AP-qg9ss 2 роки тому

      @@AnubhavMadhav google no longer allows less secure apps settings to turn on 46:00 . i was following the video and doing this project. can i still go throw with this video or is there a workaround?

  • @akankshaagarwal155
    @akankshaagarwal155 2 роки тому +1

    Great content!
    Keep up the good work. 💯

    • @AnubhavMadhav
      @AnubhavMadhav 2 роки тому +2

      Thank you so much Akanksha!😊✨

  • @francislydz4234
    @francislydz4234 Рік тому +1

    could you add mySQL as database for this?

  • @youssefmkhaouad6186
    @youssefmkhaouad6186 2 роки тому +2

    thank you, this was very helpful

  • @himanshuranjansingh6134
    @himanshuranjansingh6134 2 роки тому +3

    I'm getting an error.
    Attributerror: 'function' object has no attribute 'filter'
    While registering a new user after implementation of email functionality

    • @AnubhavMadhav
      @AnubhavMadhav 2 роки тому +2

      Yeah bro, you should try importing the auth models as mentioned in the video.

  • @MamtaYadav-hs8ho
    @MamtaYadav-hs8ho 8 місяців тому

    Cant find the github link for the project.

  • @zachfenton608
    @zachfenton608 2 роки тому +12

    Excellent tutoroial but i see you forgot to mention a step which prevented the HTML text from appearing after you put in the templates folder under authentication. You have to go into the settings under 'dirs' [] and add 'templates'

    • @AnubhavMadhav
      @AnubhavMadhav 2 роки тому +6

      Thank you so much ✨
      Well I mentioned that at 18:37 , you might have missed it no problem😊👍

    • @tembomedia6902
      @tembomedia6902 Рік тому +1

      @@AnubhavMadhav Hello, I tried this and it's still not removing the django page. What might be the problem. Am I overlooking something? Please help

  • @kiranvijay-iu2uw
    @kiranvijay-iu2uw 4 дні тому

    hi nice video , however I m beginner and got stuck , i manage to install virtualenv file successfully however next step to creating virtual environment when I put file name after virtualenv kiran , i m getting error "C:\Users\USER\Desktop\Webiste>virtualenv kiran
    'virtualenv' is not recognized as an internal or external command,
    operable program or batch file. ..where i m going wrong and there fore I am not able to command script activation also , can you kindly guide

  • @kco5127
    @kco5127 7 місяців тому

    I didn't get email part.I mean I am done with everything apart from email part.I don't know what I am doing wrong.Can anyone please help me

  • @user-zx5vl8yi5v
    @user-zx5vl8yi5v 11 місяців тому +1

    Boss you made my night many people couldnt explain well what i need now is password change

  • @yeabzerdemesie8769
    @yeabzerdemesie8769 Рік тому +1

    Less Secure apps is no longer and am stuck can anyone help?

  • @godstimebiaka9354
    @godstimebiaka9354 9 місяців тому +2

    Thanks brother

  • @KeyserTheRedBeard
    @KeyserTheRedBeard 2 роки тому +2

    interesting video GeeksforGeeks. I shattered the thumbs up on your video. Maintain up the fantastic work.

  • @kamasanitharuntejareddy1388

    i couldn't get emails, what might be the problem?

  • @dineshchellaiahc4588
    @dineshchellaiahc4588 6 місяців тому

    Bro, I entered incorrect 12 characters username and not matched password then I click enter it will show the error msg username not valid and password not matched and redirect the home page, but I check my server command prompt it shows data are posted. Why..? please fix this problem...@GeeksforGeeksVideos .

  • @user-ew2pe7qf2j
    @user-ew2pe7qf2j 5 місяців тому

    bro how is everyone able to recieve emails, i have tried 3 different projects and im unable to recieve any emails, i have tried everything but its not working at all. please help me

  • @naseempk6401
    @naseempk6401 2 роки тому

    When you are using any not imported module in this code, vs code is reminding you to import that module. How to set up that?. pls reply...

    • @AnubhavMadhav
      @AnubhavMadhav 2 роки тому +1

      Install some Intellisense extensions for Django in your VSCode.

  • @tylerlangsam8004
    @tylerlangsam8004 Рік тому

    Email part doesn't seem to be working anymore

  • @Eng-Mohamed-Ahmed
    @Eng-Mohamed-Ahmed 2 роки тому

    thanks bro finally did it