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
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
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!
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
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.
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 ;)
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.
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.
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😭😭😭
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.
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?
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
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 ?
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 ..
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.
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.
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?
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.
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
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
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.
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
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!
who are you man!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Join my free course on working with the database and models in Django: prettyprinted.com/djangodata
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
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 😢
Great, straight to te concept and example, you earn a new subscriber
Omg, these videos are really helping me a lot, please continue with these videos with django, they're excellents!!!
I'm glad they're helping you. Thanks for watching.
cant wait to see you upcoming videos
Very good explanation, really helped me understand how django auth works. Thank you!
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 :)
Thanks! I'll definitely make that video soon.
Great video!
Nice video, I was looking for that future video, couldn't find it
Really amazing explanation!
Thanks.
Awesome Explanation! Thanks alot :)
this was the hardest video to understand but I did it and I understand it, Thank you Anthony :)
Glad you understood it. Thanks for watching.
Damn great plz keep making video on entire django
fantastic video, thank you so much man :)
helped me a lot
A perfect tutorial. Thanks !
Great job! :) Nice introduction to django auth.
Thanks for watching!
thanks for making this tutorial, very useful
You're welcome! Thanks for watching.
totally worth it !!!
Do you have a video with more details on authentication?
Looking forward to your next videos with Django 2.0++. could you please make video with path parameters as slug/id ?
That's a good idea for a video. I'll see what I can do.
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
I'll consider that. Thanks for the idea.
06:35 What does {%if next%} in jinja2 do?
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
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!
Ryan Hu does this redirect if have some REDIRECT_URL in settings.py ?
How to make login form for different types of user positions?
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
Hi, my registration form is not showing on my registration page. Could you tell me why?
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.
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 ;)
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.
I have custom user model. How can I authenticate for it?
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.
Wao great video Pretty Printed. Thank for this instructive video.
You're welcome! Thanks for watching.
how do you authenticate with active directory user credentials?
is there any way to activate users account via an activation email?
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😭😭😭
thanks for this tutorial sir :) keep it up
Thanks, I appreciate it!
thank you very much. i look forward to your next videos.
are you going to do a tutorial on React and Django?
React will be sometime in the future, yes. Once I cover it, I'll cover it with Django and other backend frameworks.
www.udemy.com/course/react-django-full-stack/?referralCode=83F5A09B826E1F532E4D
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.
You don't have to use the default table. But I don't think it's a security issue to use it.
Could I change the language for example ,to spanish ,of all those help messages if I wanted? what do I have to do?
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?
it's really helpful, thanks :)
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
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 ?
I'm going to cover that as well. I just don't want the videos to be too long covering a single topic.
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 ..
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.
Pretty Printed what about remote jobs .. do you think remote jobs would enough for a man to sattled ..
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.
Its really helpful. Thanks
Glad I could help. Thanks for watching!
hii , i have to get logina and logout time for the user through signals or any other way please help me
how can I add some botstrap on the input ???
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.
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.
Thank you so much you saved my life
Glad I could help!
^_^
Register works fine for me but login fails hehat to now?? pls help me out Anthony
How "any user can't see another users posted data" in django?
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.
i wasted 1 hour >.
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?
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.
I do plan on making an allauth tutorial, so look out for that.
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
Bro without creating login page path how it was run😢
Could you make a video about signals?
I'll take that into consideration. Thanks for the idea.
Thanks for the video :)
You're welcome! Thanks for watching.
Thank you Anthony for your amazing stuff, can you help me to create virtual environment.
ModuleNotFoundError: No module named 'authenticate.view'
if someone can help me please ?
Hi, can I access you code somewhere? I don't find it in your git repositories
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
When is the more in-depth sequel coming out?
Hopefully soon. I have to plan out the next videos I'm going to make.
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.
How do I make the user admin or other roles when registering?
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.
Thanks.
it's pretty cool Mr
Thanks for watching!
How can i Change That Registration text helpers ??
Hey! what terminal are you using?
I use Ubuntu on Windows.
login required is not working djongo plz help me to mkae it work
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 ,
When I press 'login" it redirects me to the same page again, I suppose it is because I am using django 2.1
Do you have cookies enabled?
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
@@GamerFardin how did you solve it please
@@prettyprinted i have the same probleme Sir
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!
what version ur Django ?
At the time of making this video, Django 1.0.
@@prettyprinted It's 2.0, not 1.0.
@@code-dredd lol yeah, you're right. I typed that without looking haha
What happened to password hashing?
It's done by the UserCreationForm.
Pls help me, i need to add email, name and surname but i do't know how (
For those looking for the source code, here I am copied, thank you to you Pretty Printed
github.com/alexandrebouttier/django-authenticate
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
This is just an example, but I'll try to make an example that includes cell numbers.
@@prettyprinted ah,o didnt expect you'll response, thanks for your work. expecting to the new ones.
It is quite too fast for me.
The great thing about videos is you can rewatch them. :)
wow
If you guys are looking for facebook login in django, here is the tutorial: ua-cam.com/video/PtVu04V027c/v-deo.html
why are you going by so fast? wtf bro
may allah bless u brother
who are you man!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
zhango