Metadata-Version: 2.4
Name: djangocms-versioning
Version: 2.6.0
Summary: Versioning for django CMS
Author-email: Divio AG <info@divio.ch>
Maintainer-email: Django CMS Association and contributors <info@django-cms.org>
License: BSD License
Project-URL: homepage, https://github.com/django-cms/djangocms-versioning
Classifier: Framework :: Django
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.0
Classifier: Framework :: Django :: 5.1
Classifier: Framework :: Django :: 5.2
Classifier: Framework :: Django :: 6.0
Classifier: Framework :: Django :: 6.1
Classifier: Framework :: Django CMS :: 4.1
Classifier: Framework :: Django CMS :: 5.0
Classifier: Framework :: Django CMS :: 5.1
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development
Requires-Python: >=3.10
Description-Content-Type: text/x-rst
License-File: LICENSE.txt
Requires-Dist: django-cms>=4.1.1
Requires-Dist: django-fsm-2
Requires-Dist: packaging
Dynamic: license-file

|PyPiVersion| |PyVersion| |DjVersion| |CmsVersion| |Coverage|

*********************
django CMS Versioning
*********************


============
Installation
============

Requirements
============

django CMS Versioning requires that you have a django CMS 4.0 (or higher) project already running and set up.

Note: This package uses `django-fsm-2 <https://github.com/django-commons/django-fsm-2>`_ (actively maintained by Django Commons) instead of the original `django-fsm <https://github.com/viewflow/django-fsm>`_ for better support and maintenance.


To install
==========

Run::

    pip install djangocms-versioning

Add ``djangocms_versioning`` to your project's ``INSTALLED_APPS``.

Run::

    python -m manage migrate djangocms_versioning
    python -m manage create_versions --userid <user-id-of-migration-user>

to perform the application's database migrations and (only if you have an existing database) add version objects
needed to mark existing versions as draft.


=====
Usage
=====

To add versioning to your own models, start with the tutorial in
`docs/tutorials/versioning_a_blog.rst <docs/tutorials/versioning_a_blog.rst>`_. More
detailed integration instructions are available in
`docs/howto/versioning_integration.rst <docs/howto/versioning_integration.rst>`_.

An example implementation can be found here:

- `djangocms_versioning/test_utils/polls/cms_config.py <djangocms_versioning/test_utils/polls/cms_config.py>`_
- `djangocms_versioning/test_utils/polls/models.py <djangocms_versioning/test_utils/polls/models.py>`_


Testing
=======

To run all the tests the only thing you need to do is run::

    pip install -r tests/requirements/requirements_dev.txt
    pytest


Frontend assets
===============

The JavaScript bundles in ``djangocms_versioning/static/`` are built with webpack
and managed via npm scripts. Node.js 24 is required (see ``.nvmrc``).

Install dependencies::

    npm install

Common commands::

    npm run build       # production build
    npm run build:dev   # development build (sourcemaps, no minification)
    npm run watch       # rebuild on file change
    npm run lint        # ESLint over the project's JS sources

End-to-end tests with Playwright::

    npm run e2e         # runs the build with coverage instrumentation, then Playwright


Documentation
=============

The documentation is online on `readthedocs <https://djangocms-versioning.readthedocs.io>`_.

We maintain documentation in this repository under the ``docs`` folder using rst format.

To generate the HTML documentation you will need to install ``sphinx`` (``pip install sphinx``) and ``graphviz`` (as per your operating system's package management system). You can then generate the docs using the following command:

Run::

    cd docs/
    make html

This should generate all html files from rst documents under `docs/_build` folder, which can be browsed.

============
Contributing
============

Because this is a an open-source project, we welcome everyone to
`get involved in the project <https://www.django-cms.org/en/contribute/>`_ and
`receive a reward <https://www.django-cms.org/en/bounty-program/>`_ for their contribution.
Become part of a fantastic community and help us make django CMS the best CMS in the world.

We'll be delighted to receive your
feedback in the form of issues and pull requests. Before submitting your
pull request, please review our `contribution guidelines
<http://docs.django-cms.org/en/latest/contributing/index.html>`_.

The project makes use of git pre-commit hooks to maintain code quality.
Please follow the installation steps to get `pre-commit <https://pre-commit.com/#installation>`_
setup in your development environment.

We're grateful to all contributors who have helped create and maintain
this package. Contributors are listed at the `contributors
<https://github.com/django-cms/djangocms-versioning/graphs/contributors>`_
section.

One of the easiest contributions you can make is helping to translate this addon on
`Transifex <https://www.transifex.com/divio/django-cms-versioning/dashboard/>`_.
To update transifex translation in this repo you need to download the
`transifex cli <https://developers.transifex.com/docs/cli>`_ and run
``tx pull`` from the repo's root directory. After downloading the translations
do not forget to run the ``compilemessages`` management command.

.. |PyPiVersion| image:: https://img.shields.io/pypi/v/djangocms-versioning.svg?style=flat-square
    :target: https://pypi.python.org/pypi/djangocms-versioning
    :alt: Latest PyPI version

.. |PyVersion| image:: https://img.shields.io/pypi/pyversions/djangocms-versioning.svg?style=flat-square
    :target: https://pypi.python.org/pypi/djangocms-versioning
    :alt: Python versions

.. |DjVersion| image:: https://img.shields.io/pypi/frameworkversions/django/djangocms-versioning.svg?style=flat-square
    :target: https://pypi.python.org/pypi/djangocms-versioning
    :alt: Django versions

.. |CmsVersion| image:: https://img.shields.io/pypi/frameworkversions/django-cms/djangocms-versioning.svg?style=flat-square
    :target: https://pypi.python.org/pypi/djangocms-versioning
    :alt: django CMS versions

.. |Coverage| image:: https://codecov.io/gh/django-cms/djangocms-versioning/graph/badge.svg?token=Jyx7Ilpibf
 :target: https://codecov.io/gh/django-cms/djangocms-versioning
