Skip to content

Downloads

custom(zip_name)

Basically exactly the same as the /direct/ route, but for serving the symlinks with custom filenames.

Parameters:

Name Type Description Default
zip_name

the zip name

required

Returns:

Type Description

the send file response

Source code in ckanext/versioned_datastore/routes/downloads.py
21
22
23
24
25
26
27
28
29
30
31
@blueprint.route('/custom/<zip_name>')
def custom(zip_name):
    """
    Basically exactly the same as the /direct/ route, but for serving the symlinks with
    custom filenames.

    :param zip_name: the zip name
    :returns: the send file response
    """
    download_dir = toolkit.config.get('ckanext.versioned_datastore.custom_dir')
    return send_from_directory(download_dir, zip_name)

direct(zip_name)

Serves up the requested zip from the download directory. This is only registered with flask when running in debug mode and therefore is only for testing in development. In production we should always serve files through the web server.

Parameters:

Name Type Description Default
zip_name

the zip name

required

Returns:

Type Description

the send file response

Source code in ckanext/versioned_datastore/routes/downloads.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
@blueprint.route('/direct/<zip_name>')
def direct(zip_name):
    """
    Serves up the requested zip from the download directory. This is only registered
    with flask when running in debug mode and therefore is only for testing in
    development. In production we should always serve files through the web server.

    :param zip_name: the zip name
    :returns: the send file response
    """
    download_dir = toolkit.config.get('ckanext.versioned_datastore.download_dir')
    return send_from_directory(download_dir, zip_name)