forked from flashingpumpkin/django-socialregistration
-
Notifications
You must be signed in to change notification settings - Fork 1
/
urls.py
65 lines (54 loc) · 2.48 KB
/
urls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
"""
Updated on 19.12.2009
@author: alen, pinda
"""
from django.conf import settings
from django.conf.urls.defaults import *
urlpatterns = patterns('',
url('^setup/$', 'socialregistration.views.setup',
name='socialregistration_setup'),
url('^logout/$', 'socialregistration.views.logout',
name='social_logout'),
)
# Setup Facebook URLs if there's an API key specified
if 'facebook' in settings.SOCIAL_REGISTRATION_BACKENDS:
urlpatterns = urlpatterns + patterns('',
url('^facebook/login/$', 'socialregistration.views.facebook_login',
name='facebook_login'),
url('^facebook/connect/$', 'socialregistration.views.facebook_connect',
name='facebook_connect'),
url('^xd_receiver.htm', 'django.views.generic.simple.direct_to_template',
{'template':'socialregistration/xd_receiver.html'},
name='facebook_xd_receiver'),
)
# TODO: Move twitter settings to view to be able to handle multiple sites
#Setup Twitter URLs if there's an API key specified
if 'twitter' in settings.SOCIAL_REGISTRATION_BACKENDS:
urlpatterns = urlpatterns + patterns('',
url('^twitter/redirect/$', 'socialregistration.views.oauth_redirect',
dict(
consumer_key=settings.TWITTER_CONSUMER_KEY,
secret_key=settings.TWITTER_CONSUMER_SECRET_KEY,
request_token_url=settings.TWITTER_REQUEST_TOKEN_URL,
access_token_url=settings.TWITTER_ACCESS_TOKEN_URL,
authorization_url=settings.TWITTER_AUTHORIZATION_URL,
callback_url='twitter_callback'
),
name='twitter_redirect'),
url('^twitter/callback/$', 'socialregistration.views.oauth_callback',
dict(
consumer_key=settings.TWITTER_CONSUMER_KEY,
secret_key=settings.TWITTER_CONSUMER_SECRET_KEY,
request_token_url=settings.TWITTER_REQUEST_TOKEN_URL,
access_token_url=settings.TWITTER_ACCESS_TOKEN_URL,
authorization_url=settings.TWITTER_AUTHORIZATION_URL,
callback_url='twitter'
),
name='twitter_callback'
),
url('^twitter/$', 'socialregistration.views.twitter', name='twitter'),
)
urlpatterns = urlpatterns + patterns('',
url('^openid/redirect/$', 'socialregistration.views.openid_redirect', name='openid_redirect'),
url('^openid/callback/$', 'socialregistration.views.openid_callback', name='openid_callback')
)