DjangoGirls / tutorial-extensions

Additional tasks for tutorial
https://tutorial-extensions.djangogirls.org
Other
162 stars 202 forks source link

logging out #88

Closed nahusznaj closed 6 years ago

nahusznaj commented 6 years ago

I'm not sure what I missed... when I click on logout it gives me an error,

Request Method: GET

http://127.0.0.1:8000/%7B%25%20url%20'logout'%20%25 Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order: ^admin/ ^accounts/login/$ [name='login'] ^accounts/logout/$ [name='logout'] ^$ [name='post_list'] ^post/(?P\d+)/$ [name='post_detail'] ^post/new/$ [name='post_new'] ^post/(?P\d+)/edit/$ [name='post_edit'] ^post/(?P\d+)/publish/$ [name='post_publish'] ^drafts/$ [name='post_draft_list'] ^post/(?P\d+)/remove/$ [name='post_remove'] The current URL, {% url 'logout' %, didn't match any of these.

Did I miss doing something here that is not explained?

We decided to rely on Django to handle login, so let's see if Django can also handle logout for us. >Check https://docs.djangoproject.com/en/1.10/topics/auth/default/ and see if you find something.

Done reading? By now you may be thinking about adding a URL in mysite/urls.py pointing to >Django's logout view (i.e. django.contrib.auth.views.logout), like this:

aniav commented 6 years ago

you seem to have the wrong URL in browser. you should have http://127.0.0.1/accounts/logout/, and it probably is not an issue in the tutorial, so I am closing it jow ;)