Changed views.py.
In the before_request handler, added a search_enabled boolean to the g object.