thank you sir. I am new to django framework. Its literally 12:00 AM in Nepal midnight. Actually I was facing problems with adding data to the database model without using django forms. I was searching for lots of solutions but none of them was helpful, until i found yours You have saved me from my assignment submission deadline. once again thank you and Happy coding!
Damn. You explanation is so simple, straight to the point and correct. Thanks bro. You deserve more subs. The others videos I checked were just giving me uncessary nonsense.
Sir please help me i have a bank project first when user create new account and save this data is database in django and then this user want to deposite amount to own account then how to get data from database for checking user account id is same to create a account if same then deposite amount or not same id then not deposite amount to account.
Oh, that's easy. You can do it by writing more code for validation. Can be implemented either using Javascript on the client side, or python on the backend
Hi I used your method but the only difference I have more 3 fields or more than 3 properties. When I try to save my frontend data, I get "Typerror keyword argument . Please help me fix
Hmm, it is generally the same principle. But there’s a few changes that could be present but It depends on what type of form you are using. For example, the way you would grab data from a Django form is a little bit different from how you would do so from a plain html form
Dear Sir, as an admin is it possible to create account for users? They don't have to create account, Admin will create the Ac n Users will only login. And they will receive the credentials through sms.its, an educational client request. Is it possible on Django?? Kindly reply.
@@the_proton_guy Thanks a lot dear Sir! Can you provide any guidance/resources on this topic? I'm not sure with the ingredients, will django n SQL be able to do that?
Thanks bro , you saved my life . I just need little help . How can I use form.is_valid() to check input validity . And also how can I render errors this way : {%For error in form.username.error%} {{ error }} {% endfor %} This way I can render Unique contraind error to tell the user to use another unused username ...
To check if user input is valid, all you have to do is create conditionals that check if certain conditions are met. For example, if you want to check if password is less that 5 characters, you can create a conditional and say: If reques.method =="POST": password = request.POST.get("password") if len(password) < 5: print("error")
@@the_proton_guy got it, but let's say that I wanna render it as short text message bellow the input box , not a print statement , how can I accomplish that
Also, when using messages, If you want to check if the message coming in is an error message, all you have to do is use message.tags: {% for message in messages %} {% if message.tags == 'error' %} {{mesaage}} {% endif%} {% endfor %}
@@the_proton_guy im afraid you miss understood me . I just want to render an error , under the form input directly , not in form of httpresponse as u did and not buy printing it . I wanna pasa the error from my Model condition to the template
I don't know if the attribute action in form is the problem or if is the urls.py the problem because I have no error code or something like that when I do validation
s the 1: Provide a one-off default now (will be set on all existing rows with a null value for this column 2:Quit and manually define a default value in models.py.@@the_proton_guy
class addsuite(models.Model): name=models.CharField(max_length=200,null=False,blank=False) email=models.CharField(max_length=200,null=False,blank=False) phone=models.CharField(max_length=200) checkindate=models.DateField() what is wrong in this
thank you sir. I am new to django framework. Its literally 12:00 AM in Nepal midnight. Actually I was facing problems with adding data to the database model without using django forms. I was searching for lots of solutions but none of them was helpful, until i found yours You have saved me from my assignment submission deadline. once again thank you and Happy coding!
Aw, I am super happy I could help bro, cheers 🥳🥳🥳
I am always proud and happy to see brilliant Africans explain these things so easily and in a manner that resonates well with all of us. God bless you
Thank you so much 🎉🎉 I am glad I could help!
Thank you so much i am at my day before my project submission and this part tensed me alot u made this easy thank u so much
Aw, I am glad I could help 🎉
Damn!!!
I've been working on this form for over a week now, but on watching this video I've gotten it all.
Nice one brother👌
Thanks man. A sub to the channel would be helpful!
Clear explanation of the topic i was searching for , thankyou
Glad I could help 🎉
Thank you so much i have been stuck in this probleme for weeks , i'm glad i found your video you saved me Thank you Good luck💗💗 💗
Aw, I am glad I could help
Damn. You explanation is so simple, straight to the point and correct. Thanks bro. You deserve more subs. The others videos I checked were just giving me uncessary nonsense.
Thank youu, I am glad I could help😊💃
same here
Thank youu
Thank you brozay…I wanted to avoid using Django forms and here you are with a solution
Haha, I personally like avoiding using django forms too. I am glad I could help😁
Thank you for this tutorial it has saved me a lot of time.
You are welcome 🥳🥳
so so much thankyou brother , love from PUNJAB , India
🥳🥳you are welcome
Thanks Brov. You just gained a new Subscriber.
Thank you!
thanx very much bro you really helped me, hope you find all happiness
Thank you🥺🥺
excellent tutorial everything is explained :)) been searching for a video like this for a long time
Thank you. I am glad I could help 🥳
Thank you. Very clear explanation
You are welcome
This supper clearly explained 👏👏👏
Glad you understood 🥳🥳
Your explanation is very nice and simple.... I actually understand all of it, thank u, ❤
You are welcome🥳🥳
Great video. Thank you so much for the meaningful explanation. Straight to the point.
Glad I could help 🥳
Take love from bangladesh........Brother
🥳thank you bro
Awesome, just awesome, no shit and straight on point, tq so much
You're welcome 🥳
thank you amazing video this helped me so much
You are welcome 🎉
You are welcome 🎉🎉
Thank you for this content pal, keep going.
You are welcome 🥳
Nice man. Easy explanation.
Glad I could help 🥳
very helpful sir. Thank you
You are welcome 🥳
Thank You! the best video! Me ajudou muito cara! I'm from Brazil
🥳🥳you ate welcome bro
I sub only for you to continue this channel. you are doing amazing job. thanks
Thank you for the encouragement, it means a lot🥳
thanks a lot man you really helped me . God bless you
Amen. Thank you 🥳
very nice tutorial.. Thank you so much!!!!
You are welcome, glad I could help 😁😁
Was really helpful. Thanks
You are welcome 🥳
Sir please help me
i have a bank project
first when user create new account and save this data is database in django
and then this user want to deposite amount to own account then how to get data from database for checking user account id is same to create a account if same then deposite amount or not same id then not deposite amount to account.
Sorry, I do not understand your question
This video was so helpful ! Thank you :)
You're welcome :)
Thank you so much Great tutorial
I am glad I could help😊😊
Thank you bro for helpful content
You are welcome 🥳
Nice .
And here how will you make the form validation without Django forms??
Oh, that's easy. You can do it by writing more code for validation. Can be implemented either using Javascript on the client side, or python on the backend
Thank you very much
You are welcome 🥳
thanks, bro for this explain
You’re welcome!
awsome
thanks ! this was helpful !
You are welcome 🥳. A sub to the channel will be helpful 🥳
Hi I used your method but the only difference I have more 3 fields or more than 3 properties. When I try to save my frontend data, I get "Typerror keyword argument .
Please help me fix
Hiii, make sure that the name you give your input tags are the names you pass into the .get in your views.py
thnx a lot dude..
You are welcome!
Thankss brooo
You are welcome 🥳🥳🥳
you are a legend
No, we are legends😌
Thank You..
You’re welcome
Thanks a lot!
You’re welcome!
Good one
Thank youuu
You've saved my ass G!!!
🥳🥳I am glad I could help
good tutorial. thanks
I'm glad I could help😇😇
Great explanations, I understand better now. But you didn't show the urls.py in "sd " folder for the project and in "sd_app" for the app part.
I don't think there was any need to show the urls files 😅
Thank you for subscribing
is there any another method to do this?
Hmm, it is generally the same principle. But there’s a few changes that could be present but It depends on what type of form you are using. For example, the way you would grab data from a Django form is a little bit different from how you would do so from a plain html form
Dear Sir, as an admin is it possible to create account for users? They don't have to create account, Admin will create the Ac n Users will only login. And they will receive the credentials through sms.its, an educational client request. Is it possible on Django?? Kindly reply.
Yea, sure. It is possible
@@the_proton_guy Thanks a lot dear Sir! Can you provide any guidance/resources on this topic? I'm not sure with the ingredients, will django n SQL be able to do that?
Yes, sure, django and sql can do that. For sending sms to the users, you can use the django-sms library.
@@the_proton_guy I'm very grateful for your guidance. Thank you very much 🙏
You are welcome 👍👍. Django sms might have issues, but you can also check out twillio. It's also integrates with python for sms sending
It's not working for me, please help, I need to submit the demo
What error are you getting
Thanks bro , you saved my life .
I just need little help .
How can I use form.is_valid() to check input validity .
And also how can I render errors this way :
{%For error in form.username.error%}
{{ error }}
{% endfor %}
This way I can render Unique contraind error to tell the user to use another unused username ...
To check if user input is valid, all you have to do is create conditionals that check if certain conditions are met. For example, if you want to check if password is less that 5 characters, you can create a conditional and say:
If reques.method =="POST":
password = request.POST.get("password")
if len(password) < 5:
print("error")
@@the_proton_guy got it, but let's say that I wanna render it as short text message bellow the input box , not a print statement , how can I accomplish that
Also, when using messages, If you want to check if the message coming in is an error message, all you have to do is use message.tags:
{% for message in messages %}
{% if message.tags == 'error' %}
{{mesaage}}
{% endif%}
{% endfor %}
You will need to use the django messages framework. Watch this video below, it will explain how to do that:
ruclips.net/video/JCpTU9RBrHg/видео.html
@@the_proton_guy im afraid you miss understood me .
I just want to render an error , under the form input directly , not in form of httpresponse as u did and not buy printing it .
I wanna pasa the error from my Model condition to the template
how to do when we have radio button in html form and we have to save it in database
You must assign the name attribute to the radio tag and also specify the value attribute of the radio tag
merci beaucoup
You're welcome 🥳
ty bro!
You are welcome🥳💃
I do everything like you but when I click on submit nothing happens in the db
Are you sure you wrote the right code? Does your from have a method of post?
@@the_proton_guy yes. My form have a method post
But when i click submit nothing happens. It's like views.py doesn't communicate with my html form
I don't know if the attribute action in form is the problem or if is the urls.py the problem because I have no error code or something like that when I do validation
Please🤔do you use mysql or sqlite3 in your django project?
In production I make use of postgress but I use django's degault sqlite for development
i am not able to pass date from html file to admin.please help me.10 followers will get from my side
Do you see any error in the terminal?
s the 1: Provide a one-off default now (will be set on all existing rows with a null value for this column
2:Quit and manually define a default value in models.py.@@the_proton_guy
class addsuite(models.Model):
name=models.CharField(max_length=200,null=False,blank=False)
email=models.CharField(max_length=200,null=False,blank=False)
phone=models.CharField(max_length=200)
checkindate=models.DateField()
what is wrong in this
Your models look okay, however, I need to see how you are passing the date from your views to the model
def roombooking(request):
if request.method=='POST':
name=request.POST['name']
email=request.POST['email']
phone=request.POST['phone']
checkindate=request.POST['checkindate']
new_book=addsuite(name=name,email=email,phone=phone,checkindate=checkindate)
new_book.save()
return render(request, 'roombooking.html')@@the_proton_guy
ONLY ERROR WITH CHECKINDATE
Thanks Broooo
Am super impressed, Bro can you attach your email here.
Thank youu. theprotonguy@yahoo.com