【发布时间】:2018-08-06 16:58:04
【问题描述】:
我正在尝试连接到这个组织githubtraining
这是我在views.py上的代码:
def home(request):
global org
email=request.GET['email']
password=request.GET['password']
g = Github("user", "paswword")
org = g.get_organization('githubtraining')
list_rep= org.get_repos()
context = {
'list_rep': list_rep,
'org':org
}
return render(request, 'Github/repo.html',context)
但每次我尝试渲染视图时都会出现此错误:
UnicodeEncodeError at /auth/
'ascii' codec can't encode character '\u200b' in position 24: ordinal not in range(128)
这是因为我的电话有问题吗?
或者那里还有别的东西?
【问题讨论】:
-
\u200b 是一个零宽度空格,有时会插入unintentionally。您是否对代码进行了任何复制/粘贴?也许检查那个
repo.html的内容。