autogen icon indicating copy to clipboard operation
autogen copied to clipboard

AttributeError at /register/ 'str' object has no attribute 'POST'

Open Nissanx opened this issue 1 year ago • 1 comments

Describe the bug

view.py When I fill the code in " view.py" for registration application the description below: def register(request): if request.method.POST =='POST': username= request.POST.get('username') email= request.POST.get('email') password = request.POST.get('password')

	if len(password)<3:
		messages.error(request,"Password too short")
		return redirect('register')

	get_all_users_by_username= User.objects.filter(username=username)
	if get_all_users_by_username:
		messages.error(request,'Username is already taken ')
		return redirect('register')


	new_user = User.objects.create_user(usernam=username,email=email,password=password)
	new_user.save()


return render(request,'cartes/registe.html',{})

def loginpage(request): return render(request,'cates/login.html',{})

I've got the message: AttributeError at /register/ 'str' object has no attribute 'POST'

I tried all the cases possible, but no real solution, even though I change my models many times depending on some who had some suggestions in that way.

Steps to reproduce

No response

Model Used

No response

Expected Behavior

No response

Screenshots and logs

No response

Additional Information

No response

Nissanx avatar May 10 '24 13:05 Nissanx

@Nissanx this issue doesnt seem related to AutoGen, if it is, can you please add more context and logs to the above issue. Thanks

Hk669 avatar May 16 '24 19:05 Hk669