Django Authentication Basics

  Рет қаралды 109,758

Pretty Printed

Pretty Printed

Күн бұрын

Пікірлер: 131
@prettyprinted
@prettyprinted 4 жыл бұрын
Join my free course on working with the database and models in Django: prettyprinted.com/djangodata
@CrackerWeb
@CrackerWeb 3 жыл бұрын
Very strait forward explainers, great. 16:45 this is very important step you explain in just 2-3 second, I bet most of the people miss that
@dillibabu4757
@dillibabu4757 Жыл бұрын
Will u help me I have error in login page He was not create login page path so how it was run pls reply me 😢
@haroldpepete
@haroldpepete 4 жыл бұрын
Great, straight to te concept and example, you earn a new subscriber
@mzgz4216
@mzgz4216 7 жыл бұрын
cant wait to see you upcoming videos
@MrEdersonlima
@MrEdersonlima 7 жыл бұрын
Omg, these videos are really helping me a lot, please continue with these videos with django, they're excellents!!!
@prettyprinted
@prettyprinted 6 жыл бұрын
I'm glad they're helping you. Thanks for watching.
@robinkovacic7961
@robinkovacic7961 4 жыл бұрын
Very good explanation, really helped me understand how django auth works. Thank you!
@srajanjain3220
@srajanjain3220 3 жыл бұрын
Really amazing explanation! Thanks.
@fmkikomina
@fmkikomina 4 жыл бұрын
Nice video, I was looking for that future video, couldn't find it
@alialkhulaifi2423
@alialkhulaifi2423 3 жыл бұрын
Awesome Explanation! Thanks alot :)
@muralidhar40
@muralidhar40 2 жыл бұрын
06:35 What does {%if next%} in jinja2 do?
@bhushanpathrikar6045
@bhushanpathrikar6045 4 жыл бұрын
Damn great plz keep making video on entire django
@Asgallu
@Asgallu 3 жыл бұрын
Great video!
@jackli2530
@jackli2530 4 жыл бұрын
hi, this is a brief but good lesson, however, I'm confuse in code "if next" in index.html, I try google but still stuck, would u please get me a hint? thanks
@Ryuuun
@Ryuuun 4 жыл бұрын
next is a variable in the URL that holds the page user trying access but if you put @login_required above the function in views.py, then the user would be redirected to login page to login before being able to access the original page. say if I want to visit example.com/profile but I need to log in to view the page django will redirect me to /accounts/login?next=example.com/profile once you login djang then redirects you the the next URL which is profile. hope that's helpful, happy coding!
@omparikh4426
@omparikh4426 4 жыл бұрын
Ryan Hu does this redirect if have some REDIRECT_URL in settings.py ?
@SimonYells
@SimonYells 4 жыл бұрын
A perfect tutorial. Thanks !
@letoan285
@letoan285 7 жыл бұрын
Looking forward to your next videos with Django 2.0++. could you please make video with path parameters as slug/id ?
@prettyprinted
@prettyprinted 7 жыл бұрын
That's a good idea for a video. I'll see what I can do.
@TomislavMiletic
@TomislavMiletic 4 жыл бұрын
Do you have a video with more details on authentication?
@mzgz4216
@mzgz4216 7 жыл бұрын
Anthony thank you very much. your videos in django2 are the best on youtube . man how about custom authentication . what if i want to register users with phone numbers or email ?
@prettyprinted
@prettyprinted 7 жыл бұрын
I'm going to cover that as well. I just don't want the videos to be too long covering a single topic.
@mzgz4216
@mzgz4216 7 жыл бұрын
Pretty Printed man i wish you accept my friendship . your efforts are appreciated by all of us . and uli wonder why you didnt start with django tutorials long time ago . im waiting for you videos . i wish to ask you .. how you see jobs demand for django developers . man i tried with php and asp with no success . and i found that my mind only accept python . tell me your thoughts ..
@prettyprinted
@prettyprinted 7 жыл бұрын
There are plenty of jobs for all of the popular frameworks. I don't know what it's like in your area, so I'd try talking to local programmers.
@mzgz4216
@mzgz4216 7 жыл бұрын
Pretty Printed what about remote jobs .. do you think remote jobs would enough for a man to sattled ..
@prettyprinted
@prettyprinted 7 жыл бұрын
Oh yeah, I'm sure there are plenty of remote jobs for any stack you write code for, but I imagine it's harder to get a remote job.
@gonzalomcordovez
@gonzalomcordovez 3 жыл бұрын
fantastic video, thank you so much man :) helped me a lot
@mayanktripathi4u
@mayanktripathi4u 4 жыл бұрын
Hi, Could you please share some detail or video tutorial on how to handle multiple user types. For an example... a group of people (like Managers) has access to approve leaves of group of people (like Employee). I mean Managers has access to Approve.. where as Employee will not have. They can just apply for leave.
@chawza8402
@chawza8402 4 жыл бұрын
what does authenticate() does? I use the similar way as you do but in login view. but the authenticate() function always return None. when should I authenticate the user? in the Login or registration? on my site after registraion, I want the user to go back to the login.html
@derekkroeker4582
@derekkroeker4582 3 жыл бұрын
How to make login form for different types of user positions?
@eneko4562
@eneko4562 5 жыл бұрын
Could I change the language for example ,to spanish ,of all those help messages if I wanted? what do I have to do?
@matrixdexter270
@matrixdexter270 6 жыл бұрын
you should do a chartjs and django combo..everybody has been searching for this with a good explanation. you give the best anyway.kindly share the sourcecode
@prettyprinted
@prettyprinted 6 жыл бұрын
I'll consider that. Thanks for the idea.
@dellapatricia8955
@dellapatricia8955 4 жыл бұрын
Hi, my registration form is not showing on my registration page. Could you tell me why?
@kutluaydn1508
@kutluaydn1508 3 жыл бұрын
I have custom user model. How can I authenticate for it?
@OthmaneLh001
@OthmaneLh001 6 жыл бұрын
this was the hardest video to understand but I did it and I understand it, Thank you Anthony :)
@prettyprinted
@prettyprinted 6 жыл бұрын
Glad you understood it. Thanks for watching.
@АнатолийЮров-ж9л
@АнатолийЮров-ж9л 3 жыл бұрын
An interesting proposal is possible, but it is not so easy to understand all this without knowing the language. Moreover, it is necessary to take into account my knowledge and ability to use all the possibilities of the presented program. But the ability to work on a computer is also important.
@michaelkennedy5126
@michaelkennedy5126 5 жыл бұрын
thanks for making this tutorial, very useful
@prettyprinted
@prettyprinted 5 жыл бұрын
You're welcome! Thanks for watching.
@faraazali9589
@faraazali9589 4 жыл бұрын
how do you authenticate with active directory user credentials?
@axiomvp7808
@axiomvp7808 6 жыл бұрын
Best login tut i have found on django and iv watched a few now. Most use bs methods. Please do that detailed video you spoke about :)
@prettyprinted
@prettyprinted 6 жыл бұрын
Thanks! I'll definitely make that video soon.
@gautampramod1734
@gautampramod1734 4 жыл бұрын
Hey .. when u move to the admin page.. u were logged out of admin..saying u are not staff. Coz the user we created was is_active=true.. and i thik all usr from login is same.. how to get rid of such screen in the admin panel.. and when u group the user i think its not possible for evrtym when new user registered wil be grouped by admin.. i need help please.. i want to do the project😭😭😭
@AjitKumar-ul2ku
@AjitKumar-ul2ku 5 жыл бұрын
hii , i have to get logina and logout time for the user through signals or any other way please help me
@victorfariaaa
@victorfariaaa 4 жыл бұрын
Is it mandatory to use the django's default authentication users table for a project? I mean, if I want to a separate table for my users instead, is this possible? Using the same table that manage the admin users couldn't be a security issue? Thanks. Your videos are awesome.
@prettyprinted
@prettyprinted 4 жыл бұрын
You don't have to use the default table. But I don't think it's a security issue to use it.
@dude-ox2em
@dude-ox2em 4 жыл бұрын
Register works fine for me but login fails hehat to now?? pls help me out Anthony
@jokessamp5438
@jokessamp5438 4 жыл бұрын
ModuleNotFoundError: No module named 'authenticate.view' if someone can help me please ?
@mr.samarthahegde5785
@mr.samarthahegde5785 5 жыл бұрын
You are using function based views, how to make authentication with class based views and without django templates? what i mean to say is HTML pages should not define in django project instead make it available outside the project and access it by AJAX, is it possible?
@tripathi5174
@tripathi5174 4 жыл бұрын
Sir what if we have a admin and I want to delete that admin and create a new superuser, will all the data of my project or website will be lost or the actions performed by the previous admin will be lost? or there will be no change at all if i create a new super user with different name and password please help i am not able to access my previous admin and i am getting an error called as User.profile.RelatedObjectDoesNotExist: User has no profile. Please reply sir
@LexPodgorny
@LexPodgorny 5 жыл бұрын
Hello, thank you for your tutorials! They are very helpful. Question: I need to send a new user an invite link to registration with a temp password in it. How do I integrate temp passwords into this system?
@mateuscastanho7202
@mateuscastanho7202 4 жыл бұрын
how can I add some botstrap on the input ???
@NikitaDharmadhikariNikki
@NikitaDharmadhikariNikki 4 жыл бұрын
is there any way to activate users account via an activation email?
@mdwaseemahmad4256
@mdwaseemahmad4256 3 жыл бұрын
How "any user can't see another users posted data" in django?
@NiroKun23
@NiroKun23 6 жыл бұрын
Hey! Thanks to you i now can use authentication, but now i have some troubles with social media logins. I'm using this tutorial "allauth", but i can't do it. It seems that have troubles with some templates? Because i can't even login.
@prettyprinted
@prettyprinted 6 жыл бұрын
I do plan on making an allauth tutorial, so look out for that.
@aldrinsaurovsarker5159
@aldrinsaurovsarker5159 4 жыл бұрын
I wasted half of my day to find out why my login form isn't being shown and realized it won't show unless I write 'form = UserCreationForm()' in the views.login part. Idk why it worked for you ; maybe because of versions.
@B2EO
@B2EO 3 жыл бұрын
i wasted 1 hour >.
@sisyphus_619
@sisyphus_619 7 жыл бұрын
thank you very much. i look forward to your next videos. are you going to do a tutorial on React and Django?
@prettyprinted
@prettyprinted 7 жыл бұрын
React will be sometime in the future, yes. Once I cover it, I'll cover it with Django and other backend frameworks.
@SimpleUEisBetterThenComplex
@SimpleUEisBetterThenComplex 5 жыл бұрын
www.udemy.com/course/react-django-full-stack/?referralCode=83F5A09B826E1F532E4D
@sachinakula5088
@sachinakula5088 6 жыл бұрын
Hi I'm using google firebase as authentication. How can I pass firebase generated token to django auth or how can I check whether the user logged in through google firebase. Thank you
@Babaa_
@Babaa_ 6 жыл бұрын
Page not found (404) help, my register isn't working. This what I get. Request Method: GET Request URL: 127.0.0.1:8000/register Using the URLconf defined in MusicStack.urls, Django tried these URL patterns, in this order: admin/ [name='index'] new/ popular/ account/ accounts/ The current path, register, didn't match any of these.
@giridharjadala2182
@giridharjadala2182 3 жыл бұрын
totally worth it !!!
@antina314
@antina314 6 жыл бұрын
Great job! :) Nice introduction to django auth.
@prettyprinted
@prettyprinted 6 жыл бұрын
Thanks for watching!
@xtremehackerzpro9511
@xtremehackerzpro9511 7 жыл бұрын
Great video again, Django also provides custom backend auth, for example, email auth... please make next video about authorization (permission groups) :-) Pss.. else after return redirect is unnecessary ;)
@prettyprinted
@prettyprinted 7 жыл бұрын
Yeah, you're right about the else. In my mind I was thinking explicitly about difference between GET and POST, but if it's a GET request, the POST block wouldn't be run. I'll definitely cover authorization. Thanks for the idea.
@satisharvapalli3457
@satisharvapalli3457 6 жыл бұрын
Thank you Anthony for your amazing stuff, can you help me to create virtual environment.
@Alex-gn7xk
@Alex-gn7xk 6 жыл бұрын
How can i Change That Registration text helpers ??
@juliavanderkris5156
@juliavanderkris5156 6 жыл бұрын
Holy shit, Django is so awesome! Thanks for this tutorial, dude! Just one thing: is there an easy way to add more information to the user table? Like settings and stuff like that.
@prettyprinted
@prettyprinted 6 жыл бұрын
One way is to create another table that will have a relationship to the user table. I'll probably make a video on that in the future.
@marcelaguiar6815
@marcelaguiar6815 6 жыл бұрын
When is the more in-depth sequel coming out?
@prettyprinted
@prettyprinted 6 жыл бұрын
Hopefully soon. I have to plan out the next videos I'm going to make.
@dillibabu4757
@dillibabu4757 Жыл бұрын
Bro without creating login page path how it was run😢
@mohamedabdiazizhassan5056
@mohamedabdiazizhassan5056 6 жыл бұрын
login required is not working djongo plz help me to mkae it work
@OHOTOLEable
@OHOTOLEable 7 жыл бұрын
Could you make a video about signals?
@prettyprinted
@prettyprinted 6 жыл бұрын
I'll take that into consideration. Thanks for the idea.
@kenjohnsiosan9707
@kenjohnsiosan9707 6 жыл бұрын
thanks for this tutorial sir :) keep it up
@prettyprinted
@prettyprinted 6 жыл бұрын
Thanks, I appreciate it!
@varunsharma2200
@varunsharma2200 5 жыл бұрын
Its really helpful. Thanks
@prettyprinted
@prettyprinted 5 жыл бұрын
Glad I could help. Thanks for watching!
@dilipmaharjan3463
@dilipmaharjan3463 6 жыл бұрын
How do I make the user admin or other roles when registering?
@prettyprinted
@prettyprinted 6 жыл бұрын
You'd have to modify the form (or put some code in your view to handle it). I can cover that in a future video.
@dilipmaharjan3463
@dilipmaharjan3463 6 жыл бұрын
Thanks.
@rebekawa
@rebekawa 5 жыл бұрын
Hi, can I access you code somewhere? I don't find it in your git repositories
@prettyprinted
@prettyprinted 5 жыл бұрын
I usually don't host code for conceptual videos, but I do have all the code from my videos on my computer. If you want me to send it to you, just email me at anthony@prettyprinted.com
@sidyka6568
@sidyka6568 6 жыл бұрын
Wao great video Pretty Printed. Thank for this instructive video.
@prettyprinted
@prettyprinted 6 жыл бұрын
You're welcome! Thanks for watching.
@sunilrajput5149
@sunilrajput5149 4 жыл бұрын
it's really helpful, thanks :)
@GamerFardin
@GamerFardin 6 жыл бұрын
When I press 'login" it redirects me to the same page again, I suppose it is because I am using django 2.1
@prettyprinted
@prettyprinted 6 жыл бұрын
Do you have cookies enabled?
@GamerFardin
@GamerFardin 6 жыл бұрын
Most probably yes and if thats a problem well I managed to solve this problem after a few lucky guesses and I suppose the whole problem would've been solved if I just disabled cookies
@abcefg9008
@abcefg9008 6 жыл бұрын
@@GamerFardin how did you solve it please
@abcefg9008
@abcefg9008 6 жыл бұрын
@@prettyprinted i have the same probleme Sir
@GamerFardin
@GamerFardin 6 жыл бұрын
In the login.html file in line: I change the the action="{% url 'login' %}" into action="{% url 'home' %}" and I created a new path in my urls.py file which was: path('home/', views.index, name="home") and then I went to the views.py folder and defined a new function called index and added the following codes: if request.user.is_authenticated: return render(request, "myapp/index.html", {'context': request.user}) elif request.method == "POST": username = request.POST.get('username') password = request.POST.get('password') user = User.objects.create_user(username=username, password=password) user.save() a = authenticate(username=username, password=password) if a is not None: login(request, a) return render(request, "myapp/index.html", {'context': request.user}) else: return HttpResponse("something went wrong") else: return redirect("loginerror") of course you might need to make some more adjustments to this code to suit your website but I hope this helps!
@vinayaksinghsendhaw8903
@vinayaksinghsendhaw8903 3 жыл бұрын
Please provide code of this video in zip format , actually github do not show download code in zip , that's why it is so confusing to arrange files ,
@raoufm2428
@raoufm2428 6 жыл бұрын
Thank you so much you saved my life
@prettyprinted
@prettyprinted 6 жыл бұрын
Glad I could help!
@raoufm2428
@raoufm2428 6 жыл бұрын
^_^
@manutheitguy
@manutheitguy 7 жыл бұрын
Hey! what terminal are you using?
@prettyprinted
@prettyprinted 7 жыл бұрын
I use Ubuntu on Windows.
@Raj_Patel21
@Raj_Patel21 5 жыл бұрын
Thanks for the video :)
@prettyprinted
@prettyprinted 5 жыл бұрын
You're welcome! Thanks for watching.
@ArtsemLisouski
@ArtsemLisouski 6 жыл бұрын
Pls help me, i need to add email, name and surname but i do't know how (
@laluluhur4324
@laluluhur4324 6 жыл бұрын
what version ur Django ?
@prettyprinted
@prettyprinted 6 жыл бұрын
At the time of making this video, Django 1.0.
@code-dredd
@code-dredd 5 жыл бұрын
@@prettyprinted It's 2.0, not 1.0.
@prettyprinted
@prettyprinted 5 жыл бұрын
@@code-dredd lol yeah, you're right. I typed that without looking haha
@llamasarus1
@llamasarus1 6 жыл бұрын
What happened to password hashing?
@prettyprinted
@prettyprinted 6 жыл бұрын
It's done by the UserCreationForm.
@mahamata.2584
@mahamata.2584 4 жыл бұрын
it's pretty cool Mr
@prettyprinted
@prettyprinted 4 жыл бұрын
Thanks for watching!
@SocratAz
@SocratAz 6 жыл бұрын
For those looking for the source code, here I am copied, thank you to you Pretty Printed github.com/alexandrebouttier/django-authenticate
@lilredbb2182
@lilredbb2182 5 жыл бұрын
why is everyone using the buildin auth user model while the model dost not save user's cellphonenumber ...which is not very realistic to todays' App
@prettyprinted
@prettyprinted 5 жыл бұрын
This is just an example, but I'll try to make an example that includes cell numbers.
@lilredbb2182
@lilredbb2182 5 жыл бұрын
@@prettyprinted ah,o didnt expect you'll response, thanks for your work. expecting to the new ones.
@sorenchannel42
@sorenchannel42 6 жыл бұрын
It is quite too fast for me.
@prettyprinted
@prettyprinted 6 жыл бұрын
The great thing about videos is you can rewatch them. :)
@sachitad
@sachitad 5 жыл бұрын
If you guys are looking for facebook login in django, here is the tutorial: kzbin.info/www/bejne/hqW5pmNqi5VlbcU
@skatenerdify
@skatenerdify 5 жыл бұрын
why are you going by so fast? wtf bro
@hesamramezani4237
@hesamramezani4237 3 жыл бұрын
wow
@shmuel-k
@shmuel-k 6 жыл бұрын
zhango
@prasaddalavi9683
@prasaddalavi9683 6 жыл бұрын
who are you man!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@shaikbyte
@shaikbyte 5 жыл бұрын
may allah bless u brother
Passing Values Through the URL in Django
14:16
Pretty Printed
Рет қаралды 86 М.
How Many Balloons To Make A Store Fly?
00:22
MrBeast
Рет қаралды 199 МЛН
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 157 МЛН
How many people are in the changing room? #devil #lilith #funny #shorts
00:39
How to Handle User Authentication in Django
26:39
Matt Freire
Рет қаралды 86 М.
JSON Web Tokens With Django REST Framework
16:58
Pretty Printed
Рет қаралды 91 М.
Creating a Custom User Model (Django)
21:57
CodingWithMitch
Рет қаралды 104 М.
Django and htmx Tutorial: Easier Web Development
1:05:52
PyCharm, a JetBrains IDE
Рет қаралды 17 М.
Using the Django LoginView
10:14
Pretty Printed
Рет қаралды 32 М.
Login With User Authentication - Django Wednesdays #21
21:25
Codemy.com
Рет қаралды 185 М.
User registration and authentication in Django
58:35
Cloud With Django
Рет қаралды 37 М.
OAuth 2.0 and OpenID Connect (in plain English)
1:02:17
OktaDev
Рет қаралды 1,8 МЛН
How Many Balloons To Make A Store Fly?
00:22
MrBeast
Рет қаралды 199 МЛН