Fix views.py accessing app before it is initialized