我正在使用django表单,正如您在视图.py文件和结果是有一个文本框。我可以提交数值,然后使用这个数字运行脚本.py等等,我想用一个范围输入来代替文本,这样每次滑块上的值都会改变。在
我的视图.py在
def get_name(request):
form = NameForm()
if request.method == 'POST':
a = request.POST['your_name'] # do somethink with the value entered in the form
print(a)
a = int(a)
while a>0:
print(a)
a = a -1
return render(request, 'personal/code2.html', {'form': form})
我的代码2.html
^{pr2}$还有我的表单.py在
from django import forms
class NameForm(forms.Form):
your_name = forms.DurationField(label='% Brightness ')
目前没有回答
相关问题 更多 >
编程相关推荐