Skip to main content

Licensing

Licensing provides some utilities needed in order to save and show licensable content. As default it provides descriptions and localizations of Creative Commons licenses, but any license could be added.

The characters in the symbols fields of the provided Creative Commons licenses are intended to be displayed with this Creative Commons icons font: http://pfefferle.github.io/openwebicons/#cc-icons

Supported Django versions

Licensing is tested against Django versions 1.8 and 1.9.

Quick start

  1. Install it using pip

    $ pip install django-licensing

  2. Add “licensing” to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = (
        ...
        'licensing',
    )
  3. Create a model that subclass Licensed (an abstract base class)

from licensing.models import Licensed

class Whatever(Licensed):
    pass

The model Whatever will contain a ForeignKey field named license.

  1. Run python manage.py migrate to create the licensing models.

5. Where is needed to show the symbol associated with the license you can use the tag show_license: it uses the openweb font to render it; it’s simple as

{% load licensing_tags %}

{% block head %}

{% licensing_style %}

{% endblock %}
{% block foobar %}
    {% show_license license %}
{% endblock %}

where license is an instance of the License model.

The licensing_style tag simply renders a <style> block with all the necessary to use the correct font, like the code below:

/* http://pfefferle.github.io/openwebicons/usage/ */
@import url("http://weloveiconfonts.com/api/?family=openwebicons");

/* openwebicons */
i.openwebicons {
  font-family: 'OpenWeb Icons', sans-serif;
  font-style: normal;
}

It’s possible to customize the css class and template used in these tags, read the source code for more details.

Tests

If you want to modify this app, there are available several tests that you can launch to check that nothing is broken:

$ python runtests.py

It’s also available a tox configuration file to test it on multiple Django versions.

Metadata

Release files for django-licensing 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-licensing 1.0.4
File Size Uploaded Provenance
django-licensing-1.0.4.tar.gz 132.5 kB Without provenance Details

Release files / django-licensing-1.0.4.tar.gz

Download URL django-licensing-1.0.4.tar.gz
Size 132.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7b984e612609cdd118d2b4ddcf2c9111bc0d2c78f532b6acade7efacec34fa94
BLAKE2b-256 checksum
How to use checksums
a71d179b2eb2be2062c4edbb61e3f38feb93e467b710d08c1943f408d9fd6209
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7

Security for django-licensing 1.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page