Moved view to views.py file