'How can django post multiple values at once?
If you create a code like above, create a value in index.html, and press the button to print only one value. How can I solve this problem?
if request.method == 'POST':
post = Post()
post.yyyy = request.POST['yyyy']
post.mm = request.POST['mm']
post.dd = request.POST['dd']
post.cookname = request.POST['cookname']
post.save()
global post_list
post_list = {
'yyyy':post.yyyy,
'mm':post.mm,
'dd':post.dd,
'cookname':post.cookname
}
return redirect('index')
else:
post = Post.objects.all()
return render(request, 'dncapp/index.html', {'post':post})```
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
