def register(request): if request.method=="POST": q=RegForm(request.POST) if q.is_valid(): q.save() return redirect('/lg') q=RegForm() return render(request,'html/register.html',{'u':q})
def register(request): d = Category.objects.all() if request.method == "POST": q = RegForm(request.POST) if q.is_valid(): q.save() return redirect('/lg') q = RegForm() return render(request, 'html/register.html', {'u': q, 'data': d})