UnicodeDecodeError in django 1.6 and allauth
Problem solved: the secret key in my configuration file started with an (unicode) opening quote, instead of a regular double quote, probably a result of copying and pasting the original file that had been written with an editor that uses these "smarter" quotes.
I'm trying to run a django website on my local computer. It works fine on an external server, but I didn't set it up and right now I don't have access to all the specs.
The issue I have is when I try to log in the web site as a user, which has been defined. Running in debug mode I get a detailed error page containing on top the message:
UnicodeDecodeError at /accounts/login/
'ascii' codec can't decode byte 0xe2 in position 0: ordinal not in range(128)
Looking down I can see that the error occurs in crypto.py, function salted_hmac  at the line
key = hashlib.sha1((key_salt + secret).encode('utf-8')).digest()
and displaying the local variables I see
key_salt u'django.contrib.sessionsSessionStore'
secret  '\xe2\x80\x9cXXX"'
value   '{}'
where XXX is a 50 character string identical to the SECRET_KEY defined in my configuration file. Variable secret is assigned in the function through:

    if secret is None:
        secret = settings.SECRET_KEY

and I know that secret is None at this point since it is a third parameter in salted_hmac not used by the caller. I strongly suspect that the error occurs because python can not handle the unicode characters at the beginning of the variable secret.
So I have a few questions:
1) Why is setting.SECRET_KEY different from the SECRET_KEY I defined in the configuration file? Is it how it should be? And if it is do I have any control over what it should be?
2) Could something in my environment be responsible for this?
A few notes: As I mentioned it works on a server, running ubuntu 1.6, python 2.7. However I can not right now obtain the info on the versions for the other packages. But even if I could I still want to know why it doesn't work on my installation. I have tested with django 1.6.1, python 2.7 on lubuntu 14.04, opensuse 13.2, with identical results.
Thanks for any help or hint.
a