Skip to main content

Using CDN Assets(mainly JS and css) instead of downloading asset by your self.

Project description

This package help you to use CDN Assets instead of downloading js and css by your self.

Quick start

  1. Install this package:

    pip install cdn_assets

  2. Add “cdn-assets” to your INSTALLED_APPS setting like this:

  3. Using filter we provide like this:

    {% load cdn_assets %}
    {% cdn bootcss %}
        {% asset bootstrap 3.3.5 css bootstrap.min css %}
        {% asset jquery 2.2.1 jquery.min js %}
    {% endcdn %}
    This will output ::
    <script src="//"></script>
    <link href="//" rel="stylesheet">
    Explaination ::
    {% cdn bootcss %}
        {% asset jquery 2.2.1 jquery.min js %}
    {% endcdn %}
    The last parameter for asset filter is js, It would generate <script>
    If the last parameter is css, then it would be <link rel='stylesheet'>
    '/'.join() jquery 2.2.1 jquery.min -> jquery/2.2.1/jquery.min
    adding the js it becomes jquery/2.2.1/jquery.min.js
    The host is bootcss, so the url would be //
  4. CDN Host list:

        'bootcss':      '',
        'baidu':        '',
        'sinaapp':      '',
        'aspnetcdn':    '',
        'google':       '',
        'upai':         '',
        'cdnjs':        '',
        'staticfile':   '',
        '360':          ''

Project details

Release history Release notifications

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
cdn_assets-0.2.3.tar.gz (4.1 kB) Copy SHA256 hash SHA256 Source None Mar 10, 2016

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page