Skip to content

Instantly share code, notes, and snippets.

@nvie
Created March 4, 2013 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nvie/5082554 to your computer and use it in GitHub Desktop.
Save nvie/5082554 to your computer and use it in GitHub Desktop.
Broken call to set_signed_cookie() since upgrading to Django 1.5.
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe7 in position 0: ordinal not in range(128)
Stacktrace (most recent call last):
File "connect/helpers.py", line 47, in get
resp.set_signed_cookie('foo', 'bar', max_age=600)
File "django/http/response.py", line 188, in set_signed_cookie
value = signing.get_cookie_signer(salt=key + salt).sign(value)
File "django/core/signing.py", line 91, in get_cookie_signer
return Signer('django.http.cookies' + settings.SECRET_KEY, salt=salt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment