def user_profil(request):
if request.method == 'POST':
form = UserProfilForm(request.POST)
if form.is_valid():
name = UserProfil.objects.all().delete() #
form.save()
return HttpResponseRedirect('photo')
else:
form = UserProfilForm()
return render(request, 'blog/index.html', {'form': form})
def list_user(request):
name = UserProfil.objects.all()
return render(request, 'blog/photo.html', {'name': name})