request, 'core/create_account.html', {'form': form}) def post(self, request): form = AccountForm(request.POST) if form.is_valid(): account = form.save() return redirect( 'detail_account', id=account.pk) return render( request, 'core/create_account.html', {'form': form})