django-fobi/examples/simple/bar/views.py
2022-07-12 22:53:28 +02:00

14 lines
279 B
Python

from django.shortcuts import render
from .forms import MyForm
def my_view(request):
if request.method == "POST":
form = MyForm(data=request.POST)
else:
form = MyForm()
context = {"form": form}
return render(request, "bar/form.html", context)