-
Notifications
You must be signed in to change notification settings - Fork 950
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
Issue when logging out #141
Comments
It looks like this is your first issue. Welcome! 👋 One of the project maintainers will be with you as soon as possible. We appreciate your patience. To safeguard the health of the project, please take a moment to read our code of conduct. |
Thank you. Have you tried THIS repo version - and do you find the same problem? If you do, is your environment the same as the one in this project requirement.txt? If not, then you should compare your code to this project to help us isolate what is different. |
i don't think it matters if the repo is correct or not i just want to know if following the tutorial would produce the result I stated above. is this the right place to raise this kind of issue (the site that i just mentioned) |
Yes it does matter if this repo is correct or not. Almost all issues raised with this tutorial prove to be people not following the instructions properly. Yes, this is a good place to raise an issue with the tutorial, or you can raise in the mdn/content repository - either way, you'll come back to here, because I can't debug "it just doesn't work" as easily as I can debug "please compare to this working project". |
then ye it is the same as the one in the repo |
Thanks. I'll test that tomorrow then to verify. |
My testing shows the version in this repo works perfectly if you follow the instructions. When I log out I get this screen, and navigating shows that we are indeed logged out: Note that I tried this on Python 3.10 and loaded the requirements as listed in the above instructions. The link you provided above is https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Authentication#testing_the_new_authentication_pages , which clearly states that at this point the logout won't work. Is it possible that you did not get as far as the next section and implement the https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Authentication#testing_in_templates ? The next steps to debug would be for you to try this repo again. If you can't get it working there is something wrong with your environment. |
im using python 3.11 yes i have done the "testing in templates" part where i appended the changes to base_generics.html
i see. the thing that i didnt understand was this line above. was wondering what the line above would do? will it direct to admin logout? |
any update on this? |
Sorry, I missed this response.
It redirects to the registered "logged_out.html" template - in this case: https://github.com/mdn/django-locallibrary-tutorial/blob/main/templates/registration/logged_out.html Prior to Django 5 you would use a GET (url) rather than a POST (form). If you use a GET in Django 5 you may get redirected to the admin logout but you won't be logged out. To spell this out I have made this minor modification: #141 I'm closing this as "Not a defect" since this works. |
@JunkyardCat I've done some further investigation following on from another discussion. I suspect I was wrong in my response to this - it works for superuser but not for normal users. Anyway, should be fixed now by mdn/content#33385 |
Before submitting the issue, confirm that you've checked everything in the following list, and mark them as completed here:
What was incorrect, unhelpful, or unexpected?
so i followed the guide up till this part where it tests the logout (using the side bar but when i was logged out it displays the admin logout page and when i went back to home page it didn't even log out the user
https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Authentication#testing_the_new_authentication_pages
What did you expect to see?
user logged out page found in logged_out.html and also user properly logged out.
Output logs
No response
Do you have anything more you want to share?
No response
The text was updated successfully, but these errors were encountered: