13 | Add data to DB without Django form | by Hardik Patel

preview_player
Показать описание
How to post data to server from fontend?
how to store data to django model from post data?

Project - Vote the answer by admin user only.

Links -
(Used in few videos to record in some it is used to edit videos)
Рекомендации по теме
Комментарии
Автор

sir, I am following your Django series from start

asyou_
Автор

Using the URLconf defined in myproject.urls, Django tried these URL patterns, in this order:

admin/
employee/
polls/ [name='polls_list']
polls/ <int:id>/details [name='poll_details']
polls/ <int:id> [name='single_poll']

The current path, polls/POST, didn't match any of these.

ajaykumarshahi
Автор

for POST we have defined in html page, for GET is automatically detected?

vinodkumarkopperla
Автор

Hey man! If I using CreateView with automatically generated form, how can I change labels by myself? And how I can fill some fields after user click submit on this form. To the user was allowed to enter not all fields, and that they did not show.

hbtnfdb
Автор

sir how can we create dependent dropdown from database without using django forms, by using html templates only

Fragrance
Автор

First of all, Thanks for the tutorial. Can we put array or something like that in Answer.objects.create()? Because i love lots of values to insert.
Your help is appreciated.

privateconcern
Автор

Hey, I am getting FOREIGN KEY constraint failed
while submitting Poll

PRASHANTKUMAR-twhd
Автор

Hi Aarav, it will be really helpful if you can able to add Mongodb playlist and how to work with mongodb using django.

vinaykakanuru
Автор

Man how i auto populate forigen key for customize models

For eg i have parent class group with admin i want members group to be child
So how i auto populate group as forigen key for members

arunsharma
Автор

Sir, very nice tutorial but in my detail page, total no. of votes are not displaying. After choice name, this '( )' only is coming without no. of votes.

jiminaaa
Автор

sir this code prolem for me
<p>Poll is created by {{question

it is a provide error
Could not parse the remainder: ' from 'question

mustakeempython
Автор

Hii aarav

Would be helpful if you posted code

zorbagreek
Автор

I am getting the following error on this line ret = Answer.objects.create(user_id=user_id, choice_id=data['choice']) MultiValueDictKeyError 'choice'

binghamdt
Автор

I am getting an error of Foreign key constraint failed...

tusharaggarwal
Автор

Integrityerror at polls/4/
Foreign key constraint failed
Ret =

mayanksoni
Автор

I am getting Runtime error like


You called this URL via POST, but the URL doesn't end in a slash and you have APPEND_SLASH set. Django can't redirect to the slash URL while maintaining POST data. Change your form to point to 127.0.0.1:8000/poll/7/ (note the trailing slash), or set APPEND_SLASH=False in your Django settings.

hamza_ali