Revision 3c5a2b21 snf-astakos-app/astakos/im/views/target/twitter.py
b/snf-astakos-app/astakos/im/views/target/twitter.py | ||
---|---|---|
32 | 32 |
# or implied, of GRNET S.A. |
33 | 33 |
|
34 | 34 |
import logging |
35 |
import oauth2 as oauth |
|
36 |
import cgi |
|
37 |
import urllib |
|
35 | 38 |
|
36 | 39 |
from django.contrib import messages |
37 | 40 |
from django.views.decorators.http import require_http_methods |
38 | 41 |
from django.http import HttpResponseRedirect, urlencode |
39 | 42 |
from django.core.urlresolvers import reverse |
43 |
from django.conf import settings as django_settings |
|
40 | 44 |
|
41 | 45 |
from urlparse import urlunsplit, urlsplit, parse_qsl |
42 | 46 |
|
... | ... | |
47 | 51 |
init_third_party_session |
48 | 52 |
from astakos.im.views.decorators import cookie_fix, requires_auth_provider |
49 | 53 |
|
50 |
|
|
51 | 54 |
logger = logging.getLogger(__name__) |
52 | 55 |
|
53 |
import oauth2 as oauth |
|
54 |
import cgi |
|
55 |
import urllib |
|
56 | 56 |
|
57 |
request_token_url = 'https://api.twitter.com/oauth/request_token' |
|
58 |
access_token_url = 'https://api.twitter.com/oauth/access_token' |
|
59 |
authenticate_url = 'https://api.twitter.com/oauth/authenticate' |
|
57 |
def django_setting(key, default): |
|
58 |
return getattr(django_settings, 'TWITTER_%s' % key.upper, default) |
|
59 |
|
|
60 |
request_token_url = django_setting( |
|
61 |
'request_token_url', |
|
62 |
'https://api.twitter.com/oauth/request_token') |
|
63 |
access_token_url = django_setting( |
|
64 |
'access_token_url', |
|
65 |
'https://api.twitter.com/oauth/access_token') |
|
66 |
authenticate_url = django_setting( |
|
67 |
'authenticate_url', |
|
68 |
'https://api.twitter.com/oauth/authenticate') |
|
69 |
|
|
60 | 70 |
|
61 | 71 |
@requires_auth_provider('twitter') |
62 | 72 |
@require_http_methods(["GET", "POST"]) |
Also available in: Unified diff