Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Requiring Emails and Customization

Alx Ki
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Alx Ki
Python Web Development Techdegree Graduate 14,822 Points

Django-allauth doesn't get my username like in the video.

Hi Kenneth Love !

Watching the video I mentioned that django-allauth automatically got your name from GitHub. In my case it just creates user with no name or avatar etc.

Tried version from video and latest version.

Reading the docs I found information about scopes, which makes django-allauth be able to access different information:

SOCIALACCOUNT_PROVIDERS = {
    'github': {
        'SCOPE': [
            'user',
        ],
    }
}

It now has access to the info, but doesn't add that info to User's record.

UPDATE:

Well, it gets username only if you have a public email in your GitHub account.. that's strange..

What if I want django-allauth to get the username anyway? And what about avatar?

1 Answer

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

a) sorry for the late response, the email got lost somewhere in my inbox.

b) that's weird. I would assume it would get the username no matter what but maybe this is GitHub's way of protecting your data that you haven't explicitly shared. What data do you get without the public email address? Like, what username does your newly created user have?

Kenneth Love
Kenneth Love
Treehouse Guest Teacher

Weird. You might leave a bug report on django-allauth but that's likely out of their control.