[Fixed]-How to pass a GET parameter in Django in UTF-8

1👍

From the comment I found the solution, which was to use urlencode().

if object_list.count() == 0:
    from django.http import QueryDict
    response = redirect('management:customer-create')
    q = QueryDict(mutable=True)
    q['name'] = search_text
    query_string = q.urlencode() # encodes utf8 string also
    response['Location'] += '?%s' % (query_string)
    return response

Leave a comment