smart_str will just call str() if necessary and encode the result to utf8. On Py3 does uwsgi accept unicode strings as the key ? I would expect it to work with bytes but haven't tried yet ...