views: Fix exception to be compatible with python3
python3: Fix unicode and smart_unicode
python3: Fix type check
Fix relative import