Update views.py

replaced encode with smart_str