django-allauth

Redirect User to another url with django-allauth log in signal

隐身守侯 提交于 2019-11-30 13:40:01
问题 I am using Django-allauth for my login/signup related stuff, so when a user signs up(first time) into my site, I am redirecting him to /thanks/ page by defining below setting in settings.py file LOGIN_REDIRECT_URL = '/thanks/' But when the user tried to log in for the next time(if already registered) I should redirect him to '/dashboard/' URL So tried to alter that with Django-allauth signals like below which is not working at all @receiver(allauth.account.signals.user_logged_in) def

How to edit django-allauth default templates?

最后都变了- 提交于 2019-11-30 13:12:58
i'm using Django 1.10 and i want to add the allauth's app for login, signin, etc, to my website. I've installed allauth from pip, and tried to put the templates from allauth repository inside my templates folder and call them but i don't know how to make it work. TitanFighter The correct answer can be found here: https://stackoverflow.com/a/31282443/4992248 Create yourproject/templates/allauth/account/ and paste here all templates you need to edit from /myproject/Lib/site-packages/allauth/templates/account . If you need to make changes for socialaccount templates, create also yourproject

Remove 'username' field from django-allauth

家住魔仙堡 提交于 2019-11-30 11:04:19
When django-registration doesn't support django 1.5 and custom user model. I'm trying use django-allauth, from first look it's great product. Problem i have - username field required, but in my app i don't have username's. So, allauth documentation says: **Available settings:** ACCOUNT_AUTHENTICATION_METHOD (="username" | "email" | "username_email") Specifies the login method to use -- whether the user logs in by entering his username, e-mail address, or either one of both. Ok, i done, and got error: AssertionError at /accounts/signup/ No exception supplied models.py: class MyUser

Redirect User to another url with django-allauth log in signal

此生再无相见时 提交于 2019-11-30 10:56:58
I am using Django-allauth for my login/signup related stuff, so when a user signs up(first time) into my site, I am redirecting him to /thanks/ page by defining below setting in settings.py file LOGIN_REDIRECT_URL = '/thanks/' But when the user tried to log in for the next time(if already registered) I should redirect him to '/dashboard/' URL So tried to alter that with Django-allauth signals like below which is not working at all @receiver(allauth.account.signals.user_logged_in) def registered_user_login(sender, **kwargs): instance = User.objects.get_by_natural_key(kwargs['user']) print

django-allauth configuration doubts

谁说我不能喝 提交于 2019-11-30 09:50:50
I'm using django-allauth with Django 1.5.1 and I have a few questions when setting it up: 1. Configure urls.py The docs says that you have to add the following to urls.py file: urlpatterns = patterns('', ... (r'^accounts/', include('allauth.urls')), ... ) The problem is that I already have a custom app called accounts and I already use the following URL pattern: (r'^accounts/', include('accounts.urls')), So I have a naming collision here with the accounts/ regex URL. My question is: can I rename the allauth URL pattern to (r'^auth/', include('allauth.urls')) without having problems, or is it

django-allauth social account connect to existing account on login

旧街凉风 提交于 2019-11-30 06:48:20
问题 I have a custom user model and I am using django-allauth for social registration and login. I am trying to connect existing user to new social account when a user login using a social account who already has registered using email. I found this link. def pre_social_login(self, request, sociallogin): user = sociallogin.account.user if user.id: return try: customer = Customer.objects.get(email=user.email) except Customer.DoesNotExist: pass else: perform_login(request, customer, 'none') But I'm

Django 1.10.1 'my_templatetag' is not a registered tag library. Must be one of:

邮差的信 提交于 2019-11-30 02:38:37
I want a menu thats custom depending which group you are member of. Im using Django 1.10.1, allauth and so on. When im trying to make my templatetag it fails and it says:¨ TemplateSyntaxError at / 'my_templatetag' is not a registered tag library. Must be one of: account account_tags admin_list admin_modify admin_static admin_urls cache i18n l10n log socialaccount socialaccount_tags static staticfiles tz 'my_templatetag.py' looks like this: from django import template from django.contrib.auth.models import Group register = template.Library() @register.filter(name='has_group') def has_group(user

Django allauth - Multiple social accounts with a custom user

情到浓时终转凉″ 提交于 2019-11-29 23:04:17
问题 I've been trying to find how to add a new social account to a user that has already signed up and loged in, using django-allauth . So far, I have found this question, and this other question related to what I need, but what is suggested doesn't work. I'm using a custom User class, which authenticates through email, and once I have the first social account successfully created, it wont let me add another one. I've tried putting the provider_login_url in a page where the user is authenticated,

Is there any solutions to add captcha to Django-allauth?

人盡茶涼 提交于 2019-11-29 22:32:14
问题 Is there any solutions to use captcha with django-allauth? I want to use captcha on registration form for standard email+password registrations. 回答1: I too needed to do this with django-allauth and found that implementing the django-recaptcha package to be relatively simple. Configure django-recaptcha Sign up for a recaptcha account. Plug your settings in # settings.py RECAPTCHA_PUBLIC_KEY = 'xyz' RECAPTCHA_PRIVATE_KEY = 'xyz' RECAPTCHA_USE_SSL = True # Defaults to False Customize SignupForm

Multiple User Types For Auth in Django

荒凉一梦 提交于 2019-11-29 19:55:38
My web features two user types, Client and Professional . There are also two 'main modules', one for clients to buy stuff and so on (the main site), and the other for professionals to manage operations. For auth, I would like to have: A single 'sign in' form, which detects whether the user is a client or a professional and forwards her to the right module (main site or management site). Two 'sign up' forms, one for clients and other for professionals. Probably, the site will ask the user whether she wants to register as a professional or as a client, to trigger the right registration flow for