'Django OAuth Google

I tried to import urlpatterns like this on project/urls.py.

from allauth.socialaccount.providers.google.urls import urlpatterns as google_url 

But Django didn't seem to recognize that by underlining that code.

shows underlining

I don't have any clue.

Applicable settings.py INSTALLED_APPS here.

    'allauth',
    'allauth.account',
    'allauth.socialaccount',
    'allauth.socialaccount.providers.google',

and others in settings.py here,

SITE_ID = 1
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_UNIQUE_EMAIL = True
ACCOUNT_USERNAME_REQUIRED = False

SOCIALACCOUNT_PROVIDERS = {
    'google': {
        'SCOPE': [
            'profile',
            'email'
        ],
        'AUTH_PARAMS': {
            'access_type': 'online',
        }
    }
}

The path of project/urls.py below works.

path('oauth_accounts/', include('allauth.urls')),

But the next path of project/urls.py didn't work when I tried.

path('oauth_accounts/', include(google_url)),

result

I am taking a Django tutorial, so I tried to execute the latter.

Thanks in advance.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source