Esempio n. 1
0
def get_statics(path):
    """
    getting static files and return content mime types

    Args:
        path: path and filename

    Returns:
        file content and content type if file found otherwise abort(404)
    """
    static_types = __mime_types()
    return Response(get_file(os.path.join(root_dir(), path)), mimetype=static_types.get(os.path.splitext(path)[1], "text/html"))
Esempio n. 2
0
def get_statics(path):
    """
    getting static files and return content mime types

    Args:
        path: path and filename

    Returns:
        file content and content type if file found otherwise abort(404)
    """
    static_types = mime_types()
    return Response(get_file(
        os.path.join(
            nettacker_global_config()['nettacker_paths']
            ['web_static_files_path'], path)),
                    mimetype=static_types.get(
                        os.path.splitext(path)[1], "text/html"))
Esempio n. 3
0
def get_statics(path):
    static_types = __mime_types()
    return Response(get_file(os.path.join(root_dir(), path)),
                    mimetype=static_types.get(
                        os.path.splitext(path)[1], "text/html"))