Тёмный

Insert Data to Database from HTML and CSS Form in Django | Django Database Form 

THE PROTON GUY
Подписаться 2,2 тыс.
Просмотров 30 тыс.
50% 1

In this video, I will show you how to save data to the database from an html and css form in Django
**** MORE TUTORIALS ****
Django authentication: Login | Logout system: • Django Authentication ...
Learn how to make a login system with python: • Login & Register syste...
How to build a spam bot with python and pyautogui: • Build an Instagram Spa...
Learn how to make a simple currency converter with python: • Currency Converter wit...
How to host your website for free: • Host your website for ...
How to convert a python file to an exe file: • auto-py-to-exe module ...
Make a simple rock paper scissors game with python: • Rock, paper, scissors ...
Please like, share, and subscribe😁
#django
#htmlandcss
#djangoforms

Наука

Опубликовано:

 

19 янв 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 158   
@saniftamang7134
@saniftamang7134 2 года назад
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!
@the_proton_guy
@the_proton_guy 2 года назад
Aw, I am super happy I could help bro, cheers 🥳🥳🥳
@footballhighlightsbynyakwa4679
@footballhighlightsbynyakwa4679 6 месяцев назад
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
@the_proton_guy
@the_proton_guy 6 месяцев назад
Thank you so much 🎉🎉 I am glad I could help!
@davetrypiq3466
@davetrypiq3466 Год назад
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👌
@the_proton_guy
@the_proton_guy Год назад
Thanks man. A sub to the channel would be helpful!
@chrismatala4754
@chrismatala4754 2 года назад
excellent tutorial everything is explained :)) been searching for a video like this for a long time
@the_proton_guy
@the_proton_guy 2 года назад
Thank you. I am glad I could help 🥳
@lazolabucwa8821
@lazolabucwa8821 Год назад
Great video. Thank you so much for the meaningful explanation. Straight to the point.
@the_proton_guy
@the_proton_guy Год назад
Glad I could help 🥳
@laurasasso8798
@laurasasso8798 Год назад
This video was so helpful ! Thank you :)
@the_proton_guy
@the_proton_guy Год назад
You're welcome :)
@jaiharini7861
@jaiharini7861 13 дней назад
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
@the_proton_guy
@the_proton_guy 13 дней назад
Aw, I am glad I could help 🎉
@EddyDAMEN
@EddyDAMEN Год назад
Thank you for this content pal, keep going.
@the_proton_guy
@the_proton_guy Год назад
You are welcome 🥳
@marouagsr828
@marouagsr828 27 дней назад
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💗💗 💗
@the_proton_guy
@the_proton_guy 27 дней назад
Aw, I am glad I could help
@beebaMunda0
@beebaMunda0 2 года назад
so so much thankyou brother , love from PUNJAB , India
@the_proton_guy
@the_proton_guy 2 года назад
🥳🥳you are welcome
@mrtherapy309
@mrtherapy309 2 года назад
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.
@the_proton_guy
@the_proton_guy 2 года назад
Thank youu, I am glad I could help😊💃
@sylviemutuyimana7764
@sylviemutuyimana7764 Год назад
same here
@the_proton_guy
@the_proton_guy Год назад
Thank youu
@h3ncer
@h3ncer 2 года назад
Thank you brozay…I wanted to avoid using Django forms and here you are with a solution
@the_proton_guy
@the_proton_guy 2 года назад
Haha, I personally like avoiding using django forms too. I am glad I could help😁
@tejasnirmal1945
@tejasnirmal1945 Год назад
Your explanation is very nice and simple.... I actually understand all of it, thank u, ❤
@the_proton_guy
@the_proton_guy Год назад
You are welcome🥳🥳
@arashkhz
@arashkhz Год назад
thanks ! this was helpful !
@the_proton_guy
@the_proton_guy Год назад
You are welcome 🥳. A sub to the channel will be helpful 🥳
@gigatt6230
@gigatt6230 Год назад
Thank you for this tutorial it has saved me a lot of time.
@the_proton_guy
@the_proton_guy Год назад
You are welcome 🥳🥳
@Slavik332
@Slavik332 7 месяцев назад
Thank you. Very clear explanation
@the_proton_guy
@the_proton_guy 7 месяцев назад
You are welcome
@everythingthatworked
@everythingthatworked Год назад
Was really helpful. Thanks
@the_proton_guy
@the_proton_guy Год назад
You are welcome 🥳
@irafornillos3594
@irafornillos3594 2 года назад
very nice tutorial.. Thank you so much!!!!
@the_proton_guy
@the_proton_guy 2 года назад
You are welcome, glad I could help 😁😁
@md.musfiqurrahaman8612
@md.musfiqurrahaman8612 Год назад
Nice man. Easy explanation.
@the_proton_guy
@the_proton_guy Год назад
Glad I could help 🥳
@user-fp6cw2wt6c
@user-fp6cw2wt6c 8 месяцев назад
Thanks Broooo
@RahulPawar-oy3gt
@RahulPawar-oy3gt 2 года назад
Thank you so much Great tutorial
@the_proton_guy
@the_proton_guy 2 года назад
I am glad I could help😊😊
@user-de8cs5ln1p
@user-de8cs5ln1p 9 месяцев назад
This supper clearly explained 👏👏👏
@the_proton_guy
@the_proton_guy 9 месяцев назад
Glad you understood 🥳🥳
@alixaprodev
@alixaprodev 2 года назад
I sub only for you to continue this channel. you are doing amazing job. thanks
@the_proton_guy
@the_proton_guy 2 года назад
Thank you for the encouragement, it means a lot🥳
@swethaudayakumar6841
@swethaudayakumar6841 8 месяцев назад
thnx a lot dude..
@the_proton_guy
@the_proton_guy 8 месяцев назад
You are welcome!
@DemoHome-dl9jy
@DemoHome-dl9jy Год назад
thanx very much bro you really helped me, hope you find all happiness
@the_proton_guy
@the_proton_guy Год назад
Thank you🥺🥺
@rhmncfrl6541
@rhmncfrl6541 9 месяцев назад
Thank you very much
@the_proton_guy
@the_proton_guy 9 месяцев назад
You are welcome 🥳
@ramu3926
@ramu3926 Год назад
very helpful sir. Thank you
@the_proton_guy
@the_proton_guy Год назад
You are welcome 🥳
@WrongDescription
@WrongDescription 5 дней назад
Thanks a lot!
@the_proton_guy
@the_proton_guy 5 дней назад
You’re welcome!
@user-sg2nb1hj8q
@user-sg2nb1hj8q Месяц назад
thanks, bro for this explain
@the_proton_guy
@the_proton_guy Месяц назад
You’re welcome!
@sadiq.r9604
@sadiq.r9604 Год назад
Awesome, just awesome, no shit and straight on point, tq so much
@the_proton_guy
@the_proton_guy Год назад
You're welcome 🥳
@makalau3865
@makalau3865 2 года назад
Thank You! the best video! Me ajudou muito cara! I'm from Brazil
@the_proton_guy
@the_proton_guy 2 года назад
🥳🥳you ate welcome bro
@justenjoytraveling
@justenjoytraveling Год назад
Thank you bro for helpful content
@the_proton_guy
@the_proton_guy Год назад
You are welcome 🥳
@umehmoses8118
@umehmoses8118 Год назад
thanks a lot man you really helped me . God bless you
@the_proton_guy
@the_proton_guy Год назад
Amen. Thank you 🥳
@sammymathsprogramming3780
@sammymathsprogramming3780 Год назад
Good one
@the_proton_guy
@the_proton_guy Год назад
Thank youuu
@shawnbeans7389
@shawnbeans7389 Год назад
Thankss brooo
@the_proton_guy
@the_proton_guy Год назад
You are welcome 🥳🥳🥳
@lvr5823
@lvr5823 Год назад
ty bro!
@the_proton_guy
@the_proton_guy Год назад
You are welcome🥳💃
@alixaprodev
@alixaprodev 2 года назад
good tutorial. thanks
@the_proton_guy
@the_proton_guy 2 года назад
I'm glad I could help😇😇
@abdoutv5677
@abdoutv5677 2 года назад
you are a legend
@the_proton_guy
@the_proton_guy 2 года назад
No, we are legends😌
@tafsirrahman4141
@tafsirrahman4141 2 года назад
Take love from bangladesh........Brother
@the_proton_guy
@the_proton_guy 2 года назад
🥳thank you bro
@mohamedouhammi5378
@mohamedouhammi5378 Год назад
merci beaucoup
@the_proton_guy
@the_proton_guy Год назад
You're welcome 🥳
@bhargavipanuganti1905
@bhargavipanuganti1905 2 дня назад
Thank You..
@the_proton_guy
@the_proton_guy 2 дня назад
You’re welcome
@linusobura
@linusobura 2 года назад
You've saved my ass G!!!
@the_proton_guy
@the_proton_guy 2 года назад
🥳🥳I am glad I could help
@attaurrehman8352
@attaurrehman8352 Год назад
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.
@the_proton_guy
@the_proton_guy Год назад
Sorry, I do not understand your question
@nicky368
@nicky368 Год назад
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
@the_proton_guy
@the_proton_guy Год назад
Hiii, make sure that the name you give your input tags are the names you pass into the .get in your views.py
@abdulrafay42240
@abdulrafay42240 Год назад
how to do when we have radio button in html form and we have to save it in database
@the_proton_guy
@the_proton_guy Год назад
You must assign the name attribute to the radio tag and also specify the value attribute of the radio tag
@thebdr7826
@thebdr7826 Год назад
Nice . And here how will you make the form validation without Django forms??
@the_proton_guy
@the_proton_guy Год назад
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
@BrunoVlogs270121
@BrunoVlogs270121 6 месяцев назад
It's not working for me, please help, I need to submit the demo
@the_proton_guy
@the_proton_guy 6 месяцев назад
What error are you getting
@lailasatriasuhaimi5231
@lailasatriasuhaimi5231 Год назад
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.
@the_proton_guy
@the_proton_guy Год назад
I don't think there was any need to show the urls files 😅
@the_proton_guy
@the_proton_guy Год назад
Thank you for subscribing
@anjalichawla7710
@anjalichawla7710 9 месяцев назад
is there any another method to do this?
@the_proton_guy
@the_proton_guy 9 месяцев назад
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
@Kimanxo
@Kimanxo Год назад
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 ...
@the_proton_guy
@the_proton_guy Год назад
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")
@Kimanxo
@Kimanxo Год назад
@@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
@the_proton_guy
@the_proton_guy Год назад
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
@the_proton_guy Год назад
You will need to use the django messages framework. Watch this video below, it will explain how to do that: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-JCpTU9RBrHg.html
@Kimanxo
@Kimanxo Год назад
@@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
@hembromjohn
@hembromjohn Год назад
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
@the_proton_guy Год назад
Yea, sure. It is possible
@hembromjohn
@hembromjohn Год назад
@@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?
@the_proton_guy
@the_proton_guy Год назад
Yes, sure, django and sql can do that. For sending sms to the users, you can use the django-sms library.
@hembromjohn
@hembromjohn Год назад
@@the_proton_guy I'm very grateful for your guidance. Thank you very much 🙏
@the_proton_guy
@the_proton_guy Год назад
You are welcome 👍👍. Django sms might have issues, but you can also check out twillio. It's also integrates with python for sms sending
@miloxd1403
@miloxd1403 2 года назад
I do everything like you but when I click on submit nothing happens in the db
@the_proton_guy
@the_proton_guy 2 года назад
Are you sure you wrote the right code? Does your from have a method of post?
@miloxd1403
@miloxd1403 2 года назад
@@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
@miloxd1403
@miloxd1403 2 года назад
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
@miloxd1403
@miloxd1403 2 года назад
Please🤔do you use mysql or sqlite3 in your django project?
@the_proton_guy
@the_proton_guy 2 года назад
In production I make use of postgress but I use django's degault sqlite for development
@user-gg4go4se8v
@user-gg4go4se8v 5 месяцев назад
i am not able to pass date from html file to admin.please help me.10 followers will get from my side
@the_proton_guy
@the_proton_guy 5 месяцев назад
Do you see any error in the terminal?
@user-gg4go4se8v
@user-gg4go4se8v 5 месяцев назад
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
@user-gg4go4se8v
@user-gg4go4se8v 5 месяцев назад
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
@the_proton_guy
@the_proton_guy 5 месяцев назад
Your models look okay, however, I need to see how you are passing the date from your views to the model
@user-gg4go4se8v
@user-gg4go4se8v 5 месяцев назад
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
@TTL5001
@TTL5001 Год назад
Am super impressed, Bro can you attach your email here.
@the_proton_guy
@the_proton_guy Год назад
Thank youu. theprotonguy@yahoo.com
Далее
Submit Form Without Page Reload | Ajax | Ajaxify Django
15:09
ТЫ С ДРУГОМ В ДЕТСТВЕ😂#shorts
01:00
Useful & Responsive Layouts, no Media Queries required
11:03
These CSS PRO Tips & Tricks Will Blow Your Mind!
8:48
Просмотров 172 тыс.
How to Send HTML Form Data to Gmail Using JavaScript
10:49
Django python insert HTML form data into Mysql
32:55
Просмотров 31 тыс.