Пример #1
0
def initial(request):

    version_info = None
    authentication_info = None

    try:

        # Get version and build date
        version_info = _get_server_version_info().__dict__

        # Get auth info
        auth_info = _get_user_auth_info(request.user)

        # Construct response
        resp = dict(
            version_info=version_info,
            auth_info=auth_info
        )

    except Exception:

        logger.error(request._get_request)
        logger.exception('An error occured:')

    return HttpResponse(json.dumps(resp, sort_keys=False), mimetype='application/json')
Пример #2
0
def server_version_info(request):

    version_info = None

    try:

        # Get version and build date
        version_info = _get_server_version_info()

    except Exception:

        logger.error(request._get_request)
        logger.exception('An error occured:')

    return HttpResponse(json.dumps(version_info.__dict__, sort_keys=False), mimetype='application/json')