I'm a django learner and I was trying to create user registration form using the in-build UserCreationForm.
view.py
from django.shortcuts import render, redirect
from django.contrib.auth.forms import UserCreationForm
def register(request):
if request.method == 'POST':
form = UserCreationForm(request.POST)
if form.is_vaild():
username = form.cleaned_data['username']
return redirect('blog-home')
else:
form = UserCreationForm()
return render(request, 'users/register.html',{'form':form})
While trying to POST i'm receiving 'UserCreationForm' object has no attribute 'is_vaild'. If i understand correctly for all the django forms there will be a is_valid function to validate.
Please help me to find what am i missing here.
Let me know if you need any other file details.
I'm using Django 2.1,Python 3.6
As Abdul Niyas said, change
is_vaildtois_valid.