@csrf_exempt
def loadbard(request):
    msg = ""

    if type(request) == bool:
        threaded = True
        if settings.DEBUG:
            print 'Boolean request!'
    elif isinstance(request, HttpRequest):
        threaded = request.META['mod_wsgi.application_group'] == 'bard-reports'
        msg += 'mod_wsgi.application_group = "%s"' % request.META['mod_wsgi.application_group']
        if settings.DEBUG:
            print 'HttpRequest request!'
    else:
        msg += 'Unknown request type. %s' % type(request)
        threaded = False

    global bardWorkSpaceLoaded
    if settings.DEBUG:
        print 'Is BARD loaded? %s' % bardWorkSpaceLoaded

    global bardLoadingThread
    if bardWorkSpaceLoaded:
        msg = 'Bard is already loaded\n%s' % msg
    elif bardLoadingThread.is_alive():
        msg = 'Bard is already building\n%s' % msg
    elif threaded and not bardWorkSpaceLoaded and settings.REPORTS_ENABLED == 'BARD':
        bardLoadingThread.daemon = True
        bardLoadingThread.start()
        msg = 'Building bard workspace now\n%s' % msg
    else:
        msg = 'Bard will not be loaded - wrong server config or reports off.\n%s' % msg

    return HttpResponse(msg, mimetype='text/plain')
Registers controller extensions with this resource.
dataset/ETHPy150Open PublicMapping/DistrictBuilder/django/reporting/views.py/loadbard--crossover with--dataset/ETHPy150Open openstack/rack/rack/api/wsgi.py/Resource.register_extensions