VIEWS from django.shortcuts import render, redirect from django.http import HttpResponse from django.forms import inlineformset_factory from django.contrib.auth.forms import UserCreationForm from django.contrib.auth import authenticate, login, logout from django.contrib import messages from django.contrib.auth.decorators import login_required # Create your views here. from .models import * from .forms import OrderForm, CreateUserForm from .filters import OrderFilter def registerPage ( request ): if request.user.is_authenticated: return redirect( 'home' ) else : form = CreateUserForm() ...