Answer the question
In order to leave comments, you need to log in
Python. What is the correct way to store a pickle object in Mysql?
I'm trying to store a packed pickle object in MySql:
message = pickle.dumps(u'\xe7')<br>
MyModel(message=message).save()<br>
message = pickle.dumps(u'\xe7').decode('base64')
from django.utils.encoding import smart_str<br>
message = pickle.dumps(smart_str(u'\xe7'))
Answer the question
In order to leave comments, you need to log in
I have a feeling the problem here is a bit different. docs.python.org/2/howto/unicode.html
As an alternative, make the field in the database binary (for example, BLOB).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question