from django.shortcuts import render
|
from django.http import HttpResponse
|
|
from .forms import Stevila
|
|
# Create your views here.
|
|
|
def sestej(request):
|
|
form=Stevila()
|
vsota="NaN"
|
|
if request.method == "POST":
|
print(request.POST['a'])
|
form=Stevila(request.POST)
|
|
if form.is_valid():
|
vsota=float(form.data['a'])+float(form.data['b'])
|
|
print(form.data)
|
#form=Stevila()
|
return render(request, 'calculator/sestej.html', context={'formular':form, 'vsota':vsota})
|