'Identify the current domain and database, set up appropriate variables in the pandora box'

def process_request(self, request):

    domain = request.get_host().split('.')[0]
    try:
        setup_domain(domain)
    except DatabaseNotFound:
        evergreen_url = getattr(settings, 'EVERGREEN_BASE_URL', 'http://tree.io/')
        return HttpResponseRedirect(evergreen_url)
    except DatabaseError:
        from django.db import router
        from treeio.core.models import ConfigSetting
        setup_domain_database(router.db_for_read(ConfigSetting))
        return HttpResponseRedirect(reverse('database_setup'))
    box['request'] = request
