Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Nissanx opened this issue May 10, 2024 · 1 comment
Open

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

Nissanx opened this issue May 10, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Nissanx
Copy link

Nissanx commented May 10, 2024

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 Nissanx added the bug Something isn't working label May 10, 2024
@Hk669
Copy link
Collaborator

Hk669 commented May 16, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants