--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/45912e33-592c-4ca2-b618-c8fb9a1b6066n%40googlegroups.com.
def delete_account(request):if request.method == "POST":email = request.POST.get('email')password = request.POST.get('pswd1')u = User.objects.filter(email=email).first()print(u)User.delete(u.id)messages.success(request,"Account is deleted successfully.....")return redirect('home')return render(request,"account/delete_profile.html") by using this function i am trying to delete the user , but it shows me following error i.e attribute error so how can I find default id of the user which is already created at the time of registration, I am not using rest framework of django and also not created any user model in model.py file.In this way I'am registering the user def register(response):
if response.method == "POST" :username = response.POST["username"]email = response.POST["email"]password1 = response.POST["pswd1"]password2 = response.POST["pswd2"]try:myuser = User.objects.create_user(username, email, password1)myuser.password2 = password2myuser.save()#if myuser.objects.filter :if len(username) >10:messages.error(response,"Username should contain at most 10 characters.")except IntegrityError:passmessages.success(response,"You have successfully registered.")return redirect('login')return render(response,'account/registration.html')