def tq(request): form=form1(request.POST) if form.is_valid(): form=form.cleaned_data g=users(name=form['name'],password=form['password'], year=form['year'],email=form['email'],usertype=form['usertype'],branch=form['branch']) ty= User.objects.create_user(username=form['name'],email=form['email'],password=form['password']) g.save() username = form['name'] #retunr '' if no username password = form['password'] pi=ChatUser(username=username,is_chat_user=True) return HttpResponseRedirect("/login")
def signup(request): if "username" in request.session: return render(request,"Logout.html",{'name':request.session['username']}) else: cform=form1() return render(request,"form.html",{'form':cform})