# How to Get Data Form in Django
from django.shortcuts import render
from .forms import StudentRegistration
from .models import User
def show(request):
    if request.method=='POST':
        fm=StudentRegistration(request.POST)
        if fm.is_valid:
            nm=fm.cleaned_data['name']
            em=fm.cleaned_data['email']
            pw=fm.cleaned_data['password']
            reg=User(name=nm,email=em,password=pw)
            reg.save()
        else:
            fm=StudentRegistration()
    return render(request,'hello/hello.html')            
        
    