python-box:appengine-oauth
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン | |||
python-box:appengine-oauth [2017/05/13 05:53] – 以前のリビジョンを復元 (2017/05/13 05:41) dgbadmin | python-box:appengine-oauth [2017/05/13 05:54] (現在) – [その4. TwitterにOAuthでログインしてTwitter APIを使うデモ] dgbadmin | ||
---|---|---|---|
行 63: | 行 63: | ||
''' | ''' | ||
+ | import json | ||
import logging | import logging | ||
- | import | + | import |
from appengine_twitter import AppEngineTwitter | from appengine_twitter import AppEngineTwitter | ||
from basehandler import BaseHandler, | from basehandler import BaseHandler, | ||
- | from django.utils import simplejson | ||
from google.appengine.ext import db | from google.appengine.ext import db | ||
- | from google.appengine.ext import webapp | ||
行 135: | 行 134: | ||
# ここまで来ればOAuthを使ってAPIが使える。試しにユーザー名を取得 | # ここまで来ればOAuthを使ってAPIが使える。試しにユーザー名を取得 | ||
twitter.verify() | twitter.verify() | ||
- | name = simplejson.loads(twitter.last_response.content)[' | + | name = json.loads(twitter.last_response.content)[' |
self.demo_header() | self.demo_header() | ||
行 176: | 行 175: | ||
routing = [('/ | routing = [('/ | ||
| | ||
- | application = webapp.WSGIApplication(routing, | + | application = webapp2.WSGIApplication(routing, |
- | wsgiref.handlers.CGIHandler().run(application) | + | |
</ | </ | ||
python-box/appengine-oauth.txt · 最終更新: 2017/05/13 05:54 by dgbadmin