Search code examples
djangopygithub

Unicode issue with pygithub and django


I'm trying to connect to this org githubtraining

This is my code on 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)

But everytime I try to render the view I got this error:

UnicodeEncodeError at /auth/

'ascii' codec can't encode character '\u200b' in position 24: ordinal not in range(128)

Is this because of something wrong in my call?

Or maybe there's something else there?


Solution

  • Did you check the encoding of your template Github/repo.html?

    Make sure with the file settings of your text editor that it is using unicode.