Skip to main content

Fetch and deploy external resources (CSS, JS, Fonts) for web services

Project description

Sorry, this file is outdated – will be updated soon. Don’t read on. Thank you.

Installation

  1. Install this package (as editable or from the repository) into your virtual environment.

  2. Install invoke, create a tasks.py file in the root directory of your project and insert these lines:

    from external_resources.tasks import (
            get_resources,
            check_resource,
            deploy_resources,
            )
  3. Create a file external_resources.yaml containing information about the external resources that you will be needing. An example is supplied with this package.

  4. Create (or edit) the file invoke.yaml (in the same directory as tasks.py); it should specify the path of your external_resources.yaml registry and a list of resource names and optional version specifiers (like in a requirements file).

    Example:

    external_resources:
       required:
          -  bootstrap5
          -  bootstrap5_js
          -  htmx ~= 1.7
          -  lineawesome13 ~= 1.3
       config_file: external_resources.yaml
       dir_name: static_external

    The path to the config_file can either be an absolute path or relative to the directory of invoke.yaml.

    The dir_name option should point to a directory where the external resources will be installed (on your local host); depending on the kind of the resource they will go into subdirectories css, js, or fonts.

  5. The invoke command

    inv get-resources

    will try to download the resources specified as required into the dir_name target directory.

    If the integrity check code for a resource is not known, the command

    inv check-resource NAME

    will calculate and display this code which then can be pasted into the registry to make sure the correct file was retrieved on a later download.

    With

    inv deploy-resources

    the resources from the local dir_name directory (and its subdirectories) will be rsync’ed to the target host specified by the target option in invoke.yaml.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

external_resources-0.3.1.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

external_resources-0.3.1-py3-none-any.whl (30.1 kB view details)

Uploaded Python 3

File details

Details for the file external_resources-0.3.1.tar.gz.

File metadata

  • Download URL: external_resources-0.3.1.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.15

File hashes

Hashes for external_resources-0.3.1.tar.gz
Algorithm Hash digest
SHA256 b1c45b8d8fc66ad9c3e679b81c3120a93e7ab2912d30563723096a33974f31c2
MD5 58911aa80cf20d11066404b3bab5e120
BLAKE2b-256 8f20c818c47eabddd20e72e7b7c6b1af87492679e649509543aa8f16d78546d0

See more details on using hashes here.

File details

Details for the file external_resources-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for external_resources-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3315534efaf653e4d802c11fe30e4d58130b80308799e86917b6f432080367e5
MD5 476e0bdc48eab9e76204de03cfb209d4
BLAKE2b-256 6ac73589594048d5aa25964b02cea25a8d7b226d8a2be2a697caa661f7a7cfe2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page