-
Notifications
You must be signed in to change notification settings - Fork 175
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
The view accounts.views.register didn't return an HttpResponse object. It returned None instead. #6
Comments
i have the same problem, can you help me? |
`
|
I am getting this now too... It was working fine up until I tried registering recently. Not sure what broke it. |
This was a silly mistake on my part. I copy/pasted from my 'login.html' file. I forgot to close off my in both 'login.html' and 'reg_form.html'. The login worked but registering did not. Adding fixed my problem. |
I'am getting this error type object 'UserProfile' has no attribute 'objects' when trying to registering new user.When I resend data I get The view accounts.views.register didn't return an HttpResponse object. It returned None instead. I don't understand what has gone wrong. Somebody please help me. |
@vishnu-chalil try adding ,"objects = models.Manager()" in your UseProfileModel |
Thank you @AndrewOdiit .That has solved the problem |
I also encountered the same problem "The view accounts.views.register didn't return an HttpResponse object. It returned None instead" when I hit submit Button. I tried to use the above provided solutions but i got no change. Kindly help me. |
Check the indentation levels. remember that a view is always supposed to
return a render(request, 'template name')
…On Wed, Jul 4, 2018, 8:58 PM Williey-Masila ***@***.***> wrote:
I also encountered the same problem "The view accounts.views.register
didn't return an HttpResponse object. It returned None instead" when I hit
submit Button. I tried to use the above provided solutions but i got no
change. Kindly help me.
Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Ae01zURbYzTnAHm6b1PqfvcUudQ7B9rBks5uDQJAgaJpZM4Swy6N>
.
|
Thanks a lot! |
why cant I access the Userprofile with user.userprofile . It gives me error "User has no userprofile". |
Hi Man! Thank you! |
@Jumaev
|
@AlinaKozz Thank you so much!!! |
because you handled the validated data ... and you did'nt put an else statement to handle the non validated data ... so your view function returns a non object instead of an http response ... the simple solution is to add an else statement ... good luck !! |
the problem is that the code should be : cuz if u didn`t do this it and do this : the render function will execute when the value is false , but when it `s True it will not have a template to render then it will return none |
I had the same issue and i solved it , you just Edit in Class Meta: in forms.py
check the docs : Custom users and the built-in auth forms |
from django.shortcuts import render,redirect def index(request):
|
whenever I click the submit button it gives an The view todo_list.views.index didn't return an HttpResponse object. It returned None instead. how can i correct it..? can any one help me..? |
I'm getting the same error: The view users.views.login_view didn't return an HttpResponse object. It returned None instead. However I don't see any syntax error or formatting errors: def login_view(request): |
|
Guys, this project methodology is already expired, many things had been changed since he published his tutorials, I'm not even sure if he still alive or not |
First of, is this code indented properly on your end?? If yes then do this: |
Hi everyone! I have faced a problem in the below code: def register(request): I have indented it properly but still doesn't work.If anyone knows this, Please help me out. |
the error is |
You have a type error in your return redirect(reverse(registraTion)) |
so what should I do now Sir ,Please help me |
return redirect('registraion.html') |
Change return redirect(reverse(registraion)) to return redirect(reverse(registration)). |
I did it sir but still not working
…On Wed, Jul 7, 2021, 11:41 AM Gentian Collaku ***@***.***> wrote:
Hi everyone! I have faced a problem in the below code:
def register(request):
if request.method == 'POST':
user_form = UserRegistration(request.POST)
if user_form.is_valid():
user_form.save()
user = form.cleaned_data.get('username')
messages.success(request, 'Account was created for ' + user)
return redirect(reverse('registraion'))
else:
reg_form = UserRegistration()
return render(request,'registration.html',{'reg_form':reg_form})
I have indented it properly but still doesn't work.If anyone knows this,
Please help me out.
Hi everyone! I have faced a problem in the below code:
def register(request):
if request.method == 'POST':
user_form = UserRegistration(request.POST)
if user_form.is_valid():
user_form.save()
user = form.cleaned_data.get('username')
messages.success(request, 'Account was created for ' + user)
return redirect(reverse('registraion'))
else:
reg_form = UserRegistration()
return render(request,'registration.html',{'reg_form':reg_form})
I have indented it properly but still doesn't work.If anyone knows this,
Please help me out.
You have a type error in your return redirect(reverse(registraTion))
so what should I do now Sir ,Please help me
Change return redirect(reverse(registraion)) to return
redirect(reverse(registration)).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUYFJWYFHA6UFSVQLN4E6ZLTWPZHZANCNFSM4EWDF2GQ>
.
|
Believe me or not It is an indentation errorthis is my codedef contact(request): Now lock at those pictures belowif I use this one I get the same error which you mention aboveValueError at /contact But This image is the same code as I have given above. Look at this very carefully the position of **if ** minor move under the contact |
getting this error can plese anyone help The view orders.views.place_order didn't return an HttpResponse object. It returned None instead. and This is my code ...
|
Hey Maheshbist111 got the same error as well ,lemme try to debug it. |
it worked, i fixed my identation error . |
Hello Shamimgardobuya how you fix that error i written code in proper indentation but i got a error |
Hi Max,
Thank you for your youtube videos and making your materials available.
I keep running into a value error. In the Django Tutorial Part 15 I was getting the following issue: "The view accounts.views.register didn't return an HttpResponse object. It returned None instead."
I cloned this repository so I could see where I was making the mistake. The same issue occurs in the cloned repository as well.
These are the steps I take to get the error. I make migrations, then run the server. Then I go to the website and click on register, I add in the credentials (username, first name, etc.) then click submit. The website always raises: "ValueError at /account/register/"
"The view accounts.views.register didn't return an HttpResponse object. It returned None instead."
I am using windows 10.
Any help would be greatly appreciated!
Thanks,
Bradon
The text was updated successfully, but these errors were encountered: