Making CSRF work properly with python3