I saw a couple of similar questions, but they did not seem to answer the problem I am having.
So far, I have only performed manage.py runserver , working locally.
At first I tried to just put this in my .py settings:
import allauth ACCOUNT_EMAIL_REQUIRED = True
then tried to expand it to:
import allauth ACCOUNT_EMAIL_REQUIRED = True ACCOUNT_AUTHENTICATION_METHOD = "username_email" ACCOUNT_USERNAME_REQUIRED = True SOCIALACCOUNT_AUTO_SIGNUP = True
but when I try to log in with my google account (that is, openId-googlem is not direct Google), I see that it gets my email address, but it does not use my email address. In the callback function, I tried to get into a bunch of print statements, and it looked like it was extracting this from the return URL when I type user.__dict__ :
{'_state': <django.db.models.base.ModelState object at 0x101604dd0>, 'date_joined': datetime.datetime(2012, 12, 3, 4, 35, 41, 949526, tzinfo=<UTC>), 'email': u' CORRECT_USERNAME@gmail.com ', 'first_name': '', 'id': None, 'is_active': True, 'is_staff': False, 'is_superuser': False, 'last_login': datetime.datetime(2012, 12, 3, 4, 35, 41, 949506, tzinfo=<UTC>), 'last_name': '', 'password': '', 'username': ''}
That is, it fills in the email field, but not the username field. I thought by default allauth would fill in username with CORRECT_USERNAME , but instead it looks empty. Then, when I print the account, I see nothing in the user_id field.
When I bounce to the profile page, it lists username as βuserβ, which looks like an absolute reserve / default value. That is, it is:
{% user_display user %} <p>Another try... <br /> {{user.username}} <p>---------------------------</p> {{ user.account_provider }} <p>---------------------------</p> {{ user.get_provider }} <p>---------------------------</p>
gives me the following:
user Another try... user --------------------------- --------------------------- ---------------------------
I do not see errors in the server console.
Is there anything else I need to add to settings.py? Is there a callback function that I need to write in order to extract the username from the email field?
I am using python 2.6.1 (Snow Leopard) if that matters.
Thanks in advance!