Updated views.py

The index function has less code