fairdm.management.commands.seed_licenses#
Seed the licences FairDM recommends.
django-content-license ships the Creative Commons licence text and
declines to load any of it, since curating which licences a portal offers is a
decision for the portal. Nothing in FairDM loaded that fixture either, so a
freshly migrated portal had no License rows: FAIRDM_DEFAULT_LICENSE
resolved to nothing, and any form built over License.objects.all() was a
required field with an empty queryset.
This command creates the three licences FairDM recommends (CC0 1.0, CC BY 4.0
and CC BY-SA 4.0), reading their name, description, licence text and canonical
URL out of django-content-license’s own fixtures/creativecommons.json.gz
rather than retyping them. The NC and ND variants that fixture also carries are
not seeded: they fail the Open Definition, and a framework named for
reusability should not present “no derivatives” as a recommendation for
research data. A portal that wants one adds it itself.
A portal runs it on every deploy, beside sync_vocabularies, so an existing
portal picks it up on its next one. It is idempotent, keyed on License.name (unique=True on
licensing.models.License), and leaves alone a licence a portal has already
edited under one of these three names.
Usage::
python manage.py seed_licenses
Module Contents#
Classes#
Create the recommended licences that do not exist yet. |
Data#
API#
- RECOMMENDED_LICENSE_NAMES#
None
- class Command(stdout=None, stderr=None, no_color=False, force_color=False)#
Bases:
django.core.management.base.BaseCommandCreate the recommended licences that do not exist yet.
Initialization
- help#
‘Create the licences FairDM recommends (CC0 1.0, CC BY 4.0, CC BY-SA 4.0).’
- handle(*args, **options)#
Create each recommended licence, leaving existing ones unchanged.