def serve_static_file(request, filename, root=MEDIA_ROOT, force_content_type=None):
    """
    Basic handler for serving up static media files.

    Accepts an optional ``root`` (filepath string, defaults to ``MEDIA_ROOT``) parameter.
    Accepts an optional ``force_content_type`` (string, guesses if ``None``) parameter.
    """
    file_contents = static_file(filename, root)

    if force_content_type is None:
        ct = content_type(filename)
    else:
        ct = force_content_type

    return Response(file_contents, content_type=ct)


# Decorators
dataset/ETHPy150Open toastdriven/itty/itty.py/serve_static_file/original