Skip to main content
Django Light Draft https://travis-ci.org/zerc/django-light-draft.svg?branch=master https://codecov.io/gh/zerc/django-light-draft/branch/master/graph/badge.svg

Preview model changes without saving them into the database. Watch a demo on YouTube.

Requirements:

  • Django >= 1.8.x

  • Python >= 2.7.x

Quickstart

Instal the package via pip:

pip install django-light-draft

Add next lines to the settings.py of your project:

INSTALLED_APPS = (
    ...,
    'light_draft',
)

# Default settings. If you are happy with them - you can omit them.
DRAFT_SETTINGS = {
    'cache_name': 'default',  # or any other cache you may have
    'ttl': 60*5,
}

To make it work, you need to have at least default cache defined. If you are not familiar with this term check out documentation. In simpliest case you can enable in memory like this:

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
        'LOCATION': 'just-an-example',
    }
}

Then, in order to enable the feature for a particular model you need to make sure:

  1. The admin model has been inherited from light_draft.admin.DraftAdmin:

from light_draft.admin import DraftAdmin

class MyModelAdmin(DraftAdmin):
    ...
  1. The detail view of your model has been inherited from light_draft.views.BaseDraftView:

from light_draft.views import BaseDraftView

class MyModelDetailView(BaseDraftView):
    ...
  1. The model has .get_absolute_url() method defined.

See example/blog app for more details.

Contributing

See CONTRIBUTING.md file for information how you can contribute to the project. Cheers!

Licence & Authors

The MIT License (MIT)

Copyright (c) 2014 Vladimir Savin.

Metadata

Release files for django-light-draft 0.6.1

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-light-draft 0.6.1
File Size Uploaded Provenance Actions
django-light-draft-0.6.1.tar.gz 7.4 kB Without provenance Details for django-light-draft-0.6.1.tar.gz

Release files / django-light-draft-0.6.1.tar.gz

Download URL django-light-draft-0.6.1.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ed0fee06d3503075d9b0070ded37431dc775f1665f19b12e4df17d41172a0bf9
BLAKE2b-256 checksum
How to use checksums
636d4fbcbe94957e2eafa6bd079fa476c60eb6d29e40b856b9356df2ed43a0cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.7

Security for django-light-draft 0.6.1

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