write view.py