我正在处理两个类似的FB应用程序。一个工作,副本给出'错误的请求。'
Environment:
Request Method: GET
Request URL: http://doctorme.herokuapp.com/?code=AQAAWe0A6wnm24YuT066ILJMInzeJ0YPANpzb_bnS5jJRCg62KAxmTmD1m56QFVxW5DRRWRgMN8lWFNTucZpQXPHPJstRiFVPE7IfIntei-qMkNlz30SICWvfPDlfvw1g0NPBrqvkPqjZtjAF4xtR8j-WpK89ZAiMARzr3i9_GwsK6Ruhk6Zg2hqYy-qgP4CWY0
Django Version: 1.3.1
Python Version: 2.7.1
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.admindocs']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware')
Traceback:
File "/app/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "/app/doctorme/views.py" in home
14. access_token = fbapi_auth(request)[0]
File "/app/doctorme/fbapi.py" in fbapi_auth
60. encode_func=simple_dict_serialisation)
File "/app/doctorme/fbapi.py" in fbapi_get_string
48. result = urllib2.urlopen(url).read()
File "/usr/local/lib/python2.7/urllib2.py" in urlopen
126. return _opener.open(url, data, timeout)
File "/usr/local/lib/python2.7/urllib2.py" in open
398. response = meth(req, response)
File "/usr/local/lib/python2.7/urllib2.py" in http_response
511. 'http', request, response, code, msg, hdrs)
File "/usr/local/lib/python2.7/urllib2.py" in error
436. return self._call_chain(*args)
File "/usr/local/lib/python2.7/urllib2.py" in _call_chain
370. result = func(*args)
File "/usr/local/lib/python2.7/urllib2.py" in http_error_default
519. raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
Exception Type: HTTPError at /
Exception Value: HTTP Error 400: Bad Request
答案 0 :(得分:0)
检查你在FB应用程序和你的应用程序中使用正确的配置。
使用Heroku给HTTPs一个机会(即使看起来不是HTTPs的情况......),启用它只需10秒就可以了:)