Skip to content

How to use Strava with social-app in Django.?  #1330

Description

@mrpbennett

I have used this awesome package to get Google Sign On to work. However I am struggling a little bit with Strava. I have create an app within my Strava account.

I have the following in my projects settings.py file. ( i have stripped certain things out to make it easier to read)

INSTALLED_APPS = [
    'django.contrib.auth',

    'social_django',  # social auth
    'algoliasearch_django'  # algolia search
]

MIDDLEWARE = [
    'social_django.middleware.SocialAuthExceptionMiddleware',  # social auth
]
TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'social_django.context_processors.backends',  # social auth
                'social_django.context_processors.login_redirect',  # social auth
            ],
        },
    },
]

AUTHENTICATION_BACKENDS = (
    'social_core.backends.strava.StravaOAuth',  # for Strava authentication
    'django.contrib.auth.backends.ModelBackend',
)

SOCIAL_AUTH_STRAVA_KEY = '26xxx'
SOCIAL_AUTH_STRAVA_SECRET = 'dabb518395fe88748088c3351910301c48c35xxx'

SOCIAL_AUTH_URL_NAMESPACE = 'social'

my login button is the following:

 <a href="https://www.strava.com/oauth/authorize">
                <img src="{% static 'users/img/btn_strava_connectwith_orange.png' %}" alt="Connect With Strava"
                    class="mr-auto ml-auto" style="display:block;">
            </a>

where as my google btn is <a href="{% url 'social:begin' 'google-oauth2' %}">

any ideas where i am going wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions