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

Django allauth logout #36

Closed
zyjswiadomielife opened this issue Aug 13, 2020 · 10 comments
Closed

Django allauth logout #36

zyjswiadomielife opened this issue Aug 13, 2020 · 10 comments

Comments

@zyjswiadomielife
Copy link

Hi, I try to create logout link with django allauth.

In settings I try:
LETSAGREE_LOGOUT_APP_NAME = 'account_logout'
LETSAGREE_LOGOUT_APP_NAME = 'allauth:account_logout'
LETSAGREE_LOGOUT_APP_NAME = reverse_lazy('allauth')
LETSAGREE_LOGOUT_APP_NAME = reverse_lazy('allauth:account_logout')

But non of this work. Always I see: 'account_logout' is not a registered namespace etc.

How to create correct link?

Second question

How to translate button and checkbox, I must to do this in template? Or somewhere else?

@raratiru
Copy link
Owner

Hallo,

Hi, I try to create logout link with django allauth.

The "correct" setting would be:

LETSAGREE_LOGOUT_APP_NAME = 'allauth'

That, however will call:

reverse('allauth:logout')... which will do nothing because the correct path is reverse('allauth:account_logout').

Thank you for the report, I will address this issue in the weekend!

How to translate button and checkbox, I must to do this in template? Or somewhere else?

The idea for the translation is to use ./manage.py makemessages, fill the relevant entries in the .po files and then ./manage.py compilemessages to apply the changes as per the docs, have you tried it?

@zyjswiadomielife
Copy link
Author

Thank you for response. :)

I try this, to translate data, and wait for new update with repaired logout link. :)

@raratiru
Copy link
Owner

Version 1.1.2 is released, the working setting should be:

LETSAGREE_LOGOUT_APP_NAME = 'allauth:account_logout'

Is it working?

@zyjswiadomielife
Copy link
Author

I try, but still: 'allauth' is not a registered namespace

From what I was looking for information in google, allauth don't have namespace. I use only "account_logout" to create link, without allauth:account_logout

@raratiru
Copy link
Owner

So, the correct use should be:

reverse('account_logout')

Will this work?

@zyjswiadomielife
Copy link
Author

Django still search for namespace.

This time when I try, and import reverse:
LETSAGREE_LOGOUT_APP_NAME = reverse('account_logout')

Error appear:
AttributeError: 'Settings' object has no attribute 'ROOT_URLCONF'

I try also:
LETSAGREE_LOGOUT_APP_NAME = reverse_lazy('account_logout')

and then error say:
'/accounts/logout/' is not a registered namespace

@raratiru
Copy link
Owner

Please update and try the following settings:

DELETE the setting: LETSAGREE_LOGOUT_APP_NAME
add the setting: LETSAGREE_LOGOUT_URL = 'account_logout'

@zyjswiadomielife
Copy link
Author

Ok, update is pip install django-letsagree --upgrade yes?

Then delete LETSAGREE_LOGOUT_APP_NAME and add LETSAGREE_LOGOUT_URL = 'account_logout'

I don't see any error but, when show terms accept page in right top corner logout link is still /admin/logout/

I try also LETSAGREE_LOGOUT_URL = '/account/logout/'

Nothing change.

@raratiru
Copy link
Owner

Version 1.1.5 is released, can you check now? Indeed there was a bug in the code.

@zyjswiadomielife
Copy link
Author

Yes, now works 🥇

Thanks for repair this. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants