I'm facing some trouble with Unicode. I'm a beginner in programming, so I couldn't understand the other answers related to this issue here.
TraceBack
Traceback:
File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
132. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/django/django_project/learn/views.py" in index
19. if str(get_one_phrasalverb) not in cannot_be_random:
Exception Type: UnicodeEncodeError at /learn/keep-from/
Exception Value: 'ascii' codec can't encode character u'\xa0' in position 4: ordinal not in range(128)
Problematic code part
cannot_be_random = request.session.get('cannot_be_random')
if str(get_one_phrasalverb) not in cannot_be_random:
cannot_be_random.append(str(get_one_phrasalverb))
request.session['cannot_be_random'] = cannot_be_random
Please tell me if some part of the code or part of the traceback is missing.
Could someone help me, please?