Django Tutorial #20 - Saving Users

  Рет қаралды 44,444

Net Ninja

Net Ninja

Күн бұрын

Пікірлер: 79
@SwahiliSpicE
@SwahiliSpicE 3 жыл бұрын
I just have to say congrats man, I used watch your channels when you had a few thousand subs and I learned a lot about html and css from you. Now I come back after a couple of years and boom! Your channel has exploded. That's amazing; not everyone can teach but you are certainly born for it!
@NetNinja
@NetNinja 3 жыл бұрын
Thanks so much :)
@auroshisray9140
@auroshisray9140 5 жыл бұрын
Hugely respect you for such precise tutorials
@NetNinja
@NetNinja 5 жыл бұрын
Thanks so much 😊
@ghassenjemiai
@ghassenjemiai 3 жыл бұрын
Hey firstly I want to thank you Shaun for your incredible high-quality content, but what if I want to use my custom signup page with my custom fields, things like phone numbers, and other stuff like custom email domains that aren't available in the default authentication, how can I do that, please? I am pretty familiar with PHP so is it the same, like getting the inputs with its name and making a query, or is it something else in Django, thank you.
@siddharthsingh8472
@siddharthsingh8472 2 жыл бұрын
For the people getting 404 still in the post request add signup/ in urls,py as well
@anroiduser1222
@anroiduser1222 4 жыл бұрын
if you are getting the url error, after you successfully signed-up a new user. changed the return redirect code to return redirect('/articles/')
@diosdadoasumundongandeme3222
@diosdadoasumundongandeme3222 5 жыл бұрын
No entiendo inglés pero el video me ayudo mucho TANKS
@hrishomme
@hrishomme 6 жыл бұрын
The current path, accounts/signup/accounts/signup/, didn't match any of these. i`m getting this error,can u help me on how to tackle this in my form,i followed all your steps...
@embrekbuason8976
@embrekbuason8976 6 жыл бұрын
In signup.html I put action="." instead of action="accounts/signup.html" which worked for me, "." means the directory it is already in. Hope that helps.
@imammahadi352
@imammahadi352 5 жыл бұрын
@@embrekbuason8976 Thank you buddy.I was also thought about action argument.And your comment make it clear to me.Thanks again
@elenaperez6327
@elenaperez6327 3 жыл бұрын
@@embrekbuason8976 3 years later and your comment still helps people, thanks a lot!
@tonymugendi8523
@tonymugendi8523 6 жыл бұрын
For anyone getting a HttpResponse object error, make sure to add an else statement if the form is invalid if form.is_valid(): form.save() # Log user in return redirect('articles:list') else: return render(request, 'accounts/signup.html', { 'form': form })
@jaynepal2051
@jaynepal2051 6 жыл бұрын
UnboundLocalError at /accounts/signup local variable 'form' referenced before assignment
@dustbinsavesyou8283
@dustbinsavesyou8283 6 жыл бұрын
I'm having the same problem
@yeshijinsel
@yeshijinsel 6 жыл бұрын
def signup_view(request): if request.method == 'POST': form = UserCreationForm(request.POST) if form.is_valid(): form.save() #log the user in return redirect('articles:list') else: form = UserCreationForm return render(request, 'accounts/signup.html', {'form': form})
@AxmedShiimax
@AxmedShiimax 6 жыл бұрын
Thank you so much
@elyasomarr
@elyasomarr 3 жыл бұрын
Thanks a lot
@KevinTempelx
@KevinTempelx 4 жыл бұрын
form.save() only works for me if I save it to a variable. Is that something new? I don't know where that variable will come in hand later. I was hoping to get clarification.. Thank you!
@letoan285
@letoan285 6 жыл бұрын
Hello shaun, could you please have a brief explanation the differences in django 2? I have some confuse about urls
@dawitbezabih6247
@dawitbezabih6247 2 жыл бұрын
In case the redirect('articles:list') is not working for you Try redirect('list') I hope that works and check the documentation.
@trzztrzz2477
@trzztrzz2477 Жыл бұрын
life safer. Thank you!
@rahulparmar208
@rahulparmar208 6 жыл бұрын
I typed csrf_token exactly u did.. But still getting that csrf token missing error
@fahimchowdhury6355
@fahimchowdhury6355 5 жыл бұрын
same problem
@oleksandr6750
@oleksandr6750 5 жыл бұрын
had same problem, reload the server
@johnnydamilatis8281
@johnnydamilatis8281 4 жыл бұрын
I had some issues with some adblockers not letting the csrf token work properly. When i turned the blocker off it worked properly.
@PastewnyGolem
@PastewnyGolem 4 жыл бұрын
Reload the server + clear the cache in browser
@DuongTran-zh6td
@DuongTran-zh6td 2 жыл бұрын
1:25 chinh sua ham signup_view de luu tai khoan nguoi dung vao admin
@anroiduser1222
@anroiduser1222 4 жыл бұрын
I owe you alot!
@diosdadoasumundongandeme3222
@diosdadoasumundongandeme3222 5 жыл бұрын
tanks brooo
@dustbinsavesyou8283
@dustbinsavesyou8283 6 жыл бұрын
So how do you get the application on the internet in the first place, like its not a static html website its a whole server
@davidtolu2710
@davidtolu2710 5 жыл бұрын
how can we remove those guidelines that pop up on django signup html side, they should only be shown when there is an error
@peymannaji
@peymannaji 6 жыл бұрын
How can we retrieve data from Request.POST when we post normal ( Fx: Comments ) data and not something related to Django's framework like user form ?
@Kristmaz808
@Kristmaz808 5 жыл бұрын
u didnt tell us what should be in the urls.py file... where did /accounts/signup/ come from lol Update: found the answer in video #22 :)
@dec23
@dec23 6 жыл бұрын
Hi Ninja and anyone in the comments, I'm interested in only asking users to sign up for 'our newsletter' and only ask for the users email and have that stored in the database. Is this sort of the same way I would accomplish that? Does Django have system in place of that instead of the UserCreateForm function?
@argelpolicarpio6552
@argelpolicarpio6552 6 жыл бұрын
create your own forms.py inside your app
@pankajuprety9216
@pankajuprety9216 4 жыл бұрын
thank you so much
@ahmdzsakib8093
@ahmdzsakib8093 4 жыл бұрын
I got this error, I check all the URL I used everything seems fine but whenever I submit the form get this error anyone please help me Page not found (404) Request Method: POST Request URL: 127.0.0.1:8000/accounts/signup/ Using the URLconf defined in pyshop.urls, Django tried these URL patterns, in this order: admin/ products/ orders/ articles/ accounts/ signup [name='signup'] ^static/(?P.*)$ ^media/(?P.*)$ The current path, accounts/signup/, didn't match any of these.
@lightknight876
@lightknight876 6 жыл бұрын
your videos are awesome Ninja. can your followers make requests? can we beg you to do a asp.net core c# project after this one? thanks mate!
@NetNinja
@NetNinja 6 жыл бұрын
Ha, tthanks :). Yeah you can always make requests. I can't do all of tem but if enough people ask for something I generally try to do it. As for C# and ASP, I will be doing a series on this. But it won't be next. Most likely some time in the new year.
@lightknight876
@lightknight876 6 жыл бұрын
The Net Ninja Fantastic, mate! Glad I subscribed. I'll try to promote your channel. you're brilliant.
@NetNinja
@NetNinja 6 жыл бұрын
Thanks so much :). Really glad you like it.
@jafarrezazadeh846
@jafarrezazadeh846 3 жыл бұрын
hi i used the {% csrf_token %} but still i have that error what should i do?
@jafarrezazadeh846
@jafarrezazadeh846 3 жыл бұрын
no it is working, i just stop the server, run it again, and it is worked but in the video ninja did not that :)
@tinashemphisa7254
@tinashemphisa7254 4 жыл бұрын
youre good
@ZK-rf4mf
@ZK-rf4mf 6 жыл бұрын
wow....love u nijna.. :)
@NetNinja
@NetNinja 6 жыл бұрын
Thanks :)
@dfhfdgfgdfshdfhe8257
@dfhfdgfgdfshdfhe8257 6 жыл бұрын
chutiya
@clinck3439
@clinck3439 3 жыл бұрын
its not redirecting me to the article list url
@ibrahimadamou5047
@ibrahimadamou5047 Жыл бұрын
make sure your last return is outside of the if/else clause
@o-t3016
@o-t3016 4 жыл бұрын
For anyone who is getting an error this is how the views.py should be with django 3 from django.contrib.auth import authenticate, login from django.shortcuts import render , redirect from django.contrib.auth.forms import UserCreationForm from django.http import HttpResponse # Create your views here. def signup_view(request): if request.method == 'POST': form = UserCreationForm(request.POST) if form.is_valid(): form.save() # log the user in username = form.cleaned_data.get('username') messages.success(request, 'User has been created') return redirect('login') else: form = UserCreationForm() return render(request, 'accounts/signup.html', {'form':form})
@dustbinsavesyou8283
@dustbinsavesyou8283 6 жыл бұрын
UnboundLocalError at /accounts/signup/ local variable 'form' referenced before assignment I'm getting line1 as the big error line and the second line as the sub line how did you use form without defining it in the main section
@md.mizanurrahmankhan4229
@md.mizanurrahmankhan4229 6 жыл бұрын
thanks
@anutoshyt
@anutoshyt 4 жыл бұрын
The view accounts.views.signup_view didn't return an HttpResponse object. It returned None instead please help
@KevinTempelx
@KevinTempelx 4 жыл бұрын
I've been getting that for a while now..
@o-t3016
@o-t3016 4 жыл бұрын
did you find anything about this?
@KevinTempelx
@KevinTempelx 4 жыл бұрын
@@o-t3016 What you're probably experiencing is not adding your app to your settings and not having had migrated it after that? Let me know.
@denniskinoti183
@denniskinoti183 3 жыл бұрын
check your return identation
@calibur5518
@calibur5518 3 жыл бұрын
The view accounts.views.signup_view didn't return an HttpResponse object. It returned None instead.
@newtricks583
@newtricks583 3 жыл бұрын
make sure your last return is outside of the if/else clause
@ibrahimadamou5047
@ibrahimadamou5047 Жыл бұрын
@@newtricks583 Thanks very much
@vladus7704
@vladus7704 4 жыл бұрын
I don't know why but i am getting this error .NoReverseMatch: Reverse for 'detail' not found. Can someone help me?
@chantzoul
@chantzoul 4 жыл бұрын
i was getting a similar error, i accidentally used a dictionary { } instead of a list [ ] for my 'urlpatterns' located in urls.py file... hopefully that helps
@im_vj_8
@im_vj_8 Жыл бұрын
check for the form action whether the entered route is correct or not
@Lbmaniak
@Lbmaniak 6 жыл бұрын
thx
@vcg7203
@vcg7203 6 жыл бұрын
please make video on uploading image through django forms and also on update and delete data in database through forms
@hamrozjumaev
@hamrozjumaev 6 жыл бұрын
Could anyone pls assist me with this error: NoReverseMatch at /accounts/signup/
@im_vj_8
@im_vj_8 Жыл бұрын
just check your app urls name once
@shadiismailalzouabi1035
@shadiismailalzouabi1035 4 жыл бұрын
when I add user mario not added users in admin
@rahulmadhugiri
@rahulmadhugiri 3 жыл бұрын
Yeah Im having the same issue. Anyone know why that might be happening?
@DuongTran-zh6td
@DuongTran-zh6td 2 жыл бұрын
9:24 action them / va them {% crfs_token %}
@richardc9325
@richardc9325 6 жыл бұрын
ooooooooh wow a hash algorithm, fancy
@richardc9325
@richardc9325 6 жыл бұрын
4:50
@richardc9325
@richardc9325 6 жыл бұрын
YOU USED ONLY ONE EQUAL SIGN IN YOUR IF STATEMENT NOOOOOOOOOOOOOOO TOO LATE
@edgardojrpo3859
@edgardojrpo3859 6 жыл бұрын
why if i click somewhere of my /account/signup page i going to the articles page??? is that a problem??
@EMa-sf5gf
@EMa-sf5gf 5 жыл бұрын
I think he just wants to test out if the function works the way he expected.
@im_vj_8
@im_vj_8 Жыл бұрын
close the anchor tag properly in the base_layout.html
Django Tutorial #21 - Login Form
9:59
Net Ninja
Рет қаралды 92 М.
Django vs. Flask - Watch this 5-minute comparison to make your decision!
5:38
Jelvix | TECH IN 5 MINUTES
Рет қаралды 101 М.
Wait for the last one 🤣🤣 #shorts #minecraft
00:28
Cosmo Guy
Рет қаралды 21 МЛН
Sigma baby, you've conquered soap! 😲😮‍💨 LeoNata family #shorts
00:37
У вас там какие таланты ?😂
00:19
Карина Хафизова
Рет қаралды 16 МЛН
🕊️Valera🕊️
00:34
DO$HIK
Рет қаралды 18 МЛН
Django Authentication Basics
19:38
Pretty Printed
Рет қаралды 109 М.
Django Tutorial - User Specific Pages/Access
14:14
Tech With Tim
Рет қаралды 72 М.
Microservices with FastAPI - Full Course
1:28:54
freeCodeCamp.org
Рет қаралды 263 М.
How To Add Database Forms To A Web Page - Django Wednesdays #7
28:24
Add Extra Registration Fields - Django Wednesdays #25
11:42
Codemy.com
Рет қаралды 24 М.
How to Handle User Authentication in Django
26:39
Matt Freire
Рет қаралды 86 М.
Django Tutorial #27 - Foreign Keys
8:30
Net Ninja
Рет қаралды 108 М.
Wait for the last one 🤣🤣 #shorts #minecraft
00:28
Cosmo Guy
Рет қаралды 21 МЛН