Skip to content

CNFeffery/dash-change-cdn-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dash-change-cdn-plugin

GitHub PyPI Ruff

English | 简体中文

CDN source changing plugin for Dash applications using Dash Hooks, This plugin allows you to switch between different CDN sources for your Dash app's static resources.

Installation

pip install dash-change-cdn-plugin

Usage

import dash

# Import the change cdn plugin
from dash_change_cdn_plugin import setup_change_cdn_plugin

# Enable the change cdn plugin for the current app
setup_change_cdn_plugin()

# Remember to set serve_locally=False
app = dash.Dash(__name__, serve_locally=False)

# Rest of your app code...

Example

Run the included example:

python example.py

API Reference

setup_change_cdn_plugin()

This function enables the CDN source changing feature for your Dash application.

Parameter Type Default Description
cdn_source Literal["npmmirror", "jsdelivr", "fastly-jsdelivr"] "npmmirror" The CDN source to use for static resources. Options are: "npmmirror", "jsdelivr", "fastly-jsdelivr".

About

A plugin to conveniently change the CDN source for Dash applications using Dash Hooks.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages