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

Поделиться
HTML-код
  • Опубликовано: 26 ноя 2024

Комментарии • 166

  • @saniftamang7134
    @saniftamang7134 2 года назад +7

    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 года назад +1

      Aw, I am super happy I could help bro, cheers 🥳🥳🥳

  • @footballhighlightsbynyakwa4679
    @footballhighlightsbynyakwa4679 9 месяцев назад +3

    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  9 месяцев назад

      Thank you so much 🎉🎉 I am glad I could help!

  • @jaiharini7861
    @jaiharini7861 4 месяца назад +3

    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

  • @davetrypiq3466
    @davetrypiq3466 Год назад +1

    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!

  • @gamezone-py4cn
    @gamezone-py4cn Месяц назад +2

    Clear explanation of the topic i was searching for , thankyou

  • @marouagsr828
    @marouagsr828 4 месяца назад +1

    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💗💗 💗

  • @mrtherapy309
    @mrtherapy309 2 года назад +4

    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.

  • @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😁

  • @gigatt6230
    @gigatt6230 2 года назад +2

    Thank you for this tutorial it has saved me a lot of time.

  • @beebaMunda0
    @beebaMunda0 2 года назад

    so so much thankyou brother , love from PUNJAB , India

  • @taiwooladamola746
    @taiwooladamola746 Месяц назад +1

    Thanks Brov. You just gained a new Subscriber.

  • @DemoHome-dl9jy
    @DemoHome-dl9jy Год назад +1

    thanx very much bro you really helped me, hope you find all happiness

  • @chrismatala4754
    @chrismatala4754 2 года назад +1

    excellent tutorial everything is explained :)) been searching for a video like this for a long time

    • @the_proton_guy
      @the_proton_guy  2 года назад +1

      Thank you. I am glad I could help 🥳

  • @Slavik332
    @Slavik332 11 месяцев назад +1

    Thank you. Very clear explanation

  • @JavohirAkhmadjonov
    @JavohirAkhmadjonov Год назад +1

    This supper clearly explained 👏👏👏

  • @tejasnirmal1945
    @tejasnirmal1945 2 года назад

    Your explanation is very nice and simple.... I actually understand all of it, thank u, ❤

  • @lazolabucwa8821
    @lazolabucwa8821 Год назад

    Great video. Thank you so much for the meaningful explanation. Straight to the point.

  • @tafsirrahman4141
    @tafsirrahman4141 2 года назад

    Take love from bangladesh........Brother

  • @sadiq.r9604
    @sadiq.r9604 2 года назад +1

    Awesome, just awesome, no shit and straight on point, tq so much

  • @dgeneral12
    @dgeneral12 Месяц назад +1

    thank you amazing video this helped me so much

  • @EddyDAMEN
    @EddyDAMEN Год назад

    Thank you for this content pal, keep going.

  • @md.musfiqurrahaman8612
    @md.musfiqurrahaman8612 Год назад

    Nice man. Easy explanation.

  • @ramu3926
    @ramu3926 Год назад +1

    very helpful sir. Thank you

  • @makalau3865
    @makalau3865 2 года назад +1

    Thank You! the best video! Me ajudou muito cara! I'm from Brazil

  • @alixaprodev
    @alixaprodev 2 года назад +1

    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🥳

  • @umehmoses8118
    @umehmoses8118 Год назад

    thanks a lot man you really helped me . God bless you

  • @irafornillos3594
    @irafornillos3594 2 года назад +1

    very nice tutorial.. Thank you so much!!!!

    • @the_proton_guy
      @the_proton_guy  2 года назад +1

      You are welcome, glad I could help 😁😁

  • @everythingthatworked
    @everythingthatworked 2 года назад +1

    Was really helpful. Thanks

  • @attaurrehman8352
    @attaurrehman8352 2 года назад +1

    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  2 года назад

      Sorry, I do not understand your question

  • @laurasasso8798
    @laurasasso8798 2 года назад

    This video was so helpful ! Thank you :)

  • @RahulPawar-oy3gt
    @RahulPawar-oy3gt 2 года назад +1

    Thank you so much Great tutorial

  • @justenjoytraveling
    @justenjoytraveling Год назад

    Thank you bro for helpful content

  • @thebdr7826
    @thebdr7826 Год назад +1

    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

  • @rhmncfrl6541
    @rhmncfrl6541 Год назад +1

    Thank you very much

  • @ibrahim-k4e3t
    @ibrahim-k4e3t 4 месяца назад

    thanks, bro for this explain

  • @armin.falahatkar
    @armin.falahatkar 2 месяца назад +1

    awsome

  • @arashkhz
    @arashkhz Год назад

    thanks ! this was helpful !

    • @the_proton_guy
      @the_proton_guy  Год назад +1

      You are welcome 🥳. A sub to the channel will be helpful 🥳

  • @nicky368
    @nicky368 2 года назад +1

    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  2 года назад

      Hiii, make sure that the name you give your input tags are the names you pass into the .get in your views.py

  • @swethaudayakumar6841
    @swethaudayakumar6841 Год назад +1

    thnx a lot dude..

  • @shawnbeans7389
    @shawnbeans7389 Год назад +2

    Thankss brooo

  • @abdoutv5677
    @abdoutv5677 2 года назад +1

    you are a legend

  • @bhargavipanuganti1905
    @bhargavipanuganti1905 3 месяца назад +1

    Thank You..

  • @WrongDescription
    @WrongDescription 3 месяца назад

    Thanks a lot!

  • @sammymathsprogramming3780
    @sammymathsprogramming3780 Год назад

    Good one

  • @linusobura
    @linusobura 2 года назад +1

    You've saved my ass G!!!

  • @alixaprodev
    @alixaprodev 2 года назад

    good tutorial. thanks

  • @lailasatriasuhaimi5231
    @lailasatriasuhaimi5231 2 года назад

    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  2 года назад

      I don't think there was any need to show the urls files 😅

    • @the_proton_guy
      @the_proton_guy  2 года назад

      Thank you for subscribing

  • @anjalichawla7710
    @anjalichawla7710 Год назад +1

    is there any another method to do this?

    • @the_proton_guy
      @the_proton_guy  Год назад

      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

  • @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  Год назад +1

      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  Год назад +1

      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

  • @BrunoVlogs270121
    @BrunoVlogs270121 9 месяцев назад

    It's not working for me, please help, I need to submit the demo

  • @Kimanxo
    @Kimanxo 2 года назад

    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  2 года назад

      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 2 года назад

      @@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  2 года назад

      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  2 года назад

      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

    • @Kimanxo
      @Kimanxo 2 года назад

      @@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

  • @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

  • @mohamedouhammi5378
    @mohamedouhammi5378 2 года назад

    merci beaucoup

  • @lvr5823
    @lvr5823 2 года назад

    ty bro!

  • @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 года назад +1

      Are you sure you wrote the right code? Does your from have a method of post?

    • @miloxd1403
      @miloxd1403 2 года назад +1

      @@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 года назад +1

      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 года назад +1

      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

  • @kruthikbv
    @kruthikbv 8 месяцев назад

    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  8 месяцев назад

      Do you see any error in the terminal?

    • @kruthikbv
      @kruthikbv 8 месяцев назад

      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

    • @kruthikbv
      @kruthikbv 8 месяцев назад

      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  8 месяцев назад

      Your models look okay, however, I need to see how you are passing the date from your views to the model

    • @kruthikbv
      @kruthikbv 8 месяцев назад

      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

  • @dineshraj-l2m
    @dineshraj-l2m Год назад +1

    Thanks Broooo

  • @TTL5001
    @TTL5001 Год назад

    Am super impressed, Bro can you attach your email here.