Posts

Showing posts from March 3, 2019

Error while doing POST 'UserCreationForm' object has no attribute 'is_vaild'

Image
0 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.