omab / python-social-auth

Social auth made simple
http://psa.matiasaguirre.net
BSD 3-Clause "New" or "Revised" License
2.83k stars 1.09k forks source link

python-social-auth template url to jinja template url #942

Closed kkampardi closed 7 years ago

kkampardi commented 8 years ago

How can i convert this django url tag

{% url "social:begin" "github" %}

to the proper jinja url tag? I have already tried

{% set myurl=url("social:begin", "github") %}

and then use the {{url}}

but i get an

ImportError at /login/

No module named github

My settings.py:


        UTHENTICATION_BACKENDS = ('social.backends.github.GithubOAuth2',)

        SOCIAL_AUTH_GITHUB_KEY = '75ba4983720f9852c22a'
        SOCIAL_AUTH_GITHUB_SECRET = '7e43083e9ee92bd95ad195064f3aaa91704cbfe0'

        INSTALLED_APPS = [
         'social.apps.django_app.default',
        ]

and my urls.py:

.....

i18n_urls = [
    url(r'^$', 'zerver.views.home'),
    url('social-auth/', include('social.apps.django_app.urls', namespace='social')),

.....

omab commented 7 years ago

Like this https://github.com/python-social-auth/social-examples/blob/master/example-common/templates/home.html#L39.