我正在尝试使用github oauth.我使用urllib和urllib2并拥有以下代码:
def github_login(request):
post_data = [('client_id','****'),('redirect_uri','http://localhost:8000/callback')]
result = urllib2.urlopen('https://github.com/login/oauth/authorize', urllib.urlencode(post_data))
content = result.read()
Run Code Online (Sandbox Code Playgroud)
发送查询后我有httperror 403.我已经在settings.py中配置了allowed_hosts