djangocms-picture


Namedjangocms-picture JSON
Version 4.1.1 PyPI version JSON
download
home_pagehttps://github.com/django-cms/djangocms-picture
SummaryAdds an image plugin to django CMS
upload_time2023-10-19 15:34:23
maintainerDjango CMS Association and contributors
docs_urlNone
authorDivio AG
requires_python
licenseBSD-3-Clause
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            ==================
django CMS Picture
==================

|pypi| |build| |coverage|

**django CMS Picture** is a plugin for `django CMS <http://django-cms.org>`_
that allows you to add images on your site.

.. note::

        This project is endorsed by the `django CMS Association <https://www.django-cms.org/en/about-us/>`_.
        That means that it is officially accepted by the dCA as being in line with our roadmap vision and development/plugin policy.
        Join us on `Slack <https://www.django-cms.org/slack/>`_.

.. image:: preview.gif



*******************************************
Contribute to this project and win rewards
*******************************************

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>`_.

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-picture/graphs/contributors>`_
section.

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

See ``REQUIREMENTS`` in the `setup.py <https://github.com/divio/djangocms-picture/blob/master/setup.py>`_
file for additional dependencies:

|python| |django| |djangocms|

* Django Filer 1.7 or higher

Make sure `django-filer <http://django-filer.readthedocs.io/en/latest/installation.html>`_
is installed and configured appropriately.


Installation
------------

For a manual install:

* run ``pip install djangocms-picture``
* add ``djangocms_picture`` to your ``INSTALLED_APPS``
* run ``python manage.py migrate djangocms_picture``


Configuration
-------------

Note that the provided templates are very minimal by design. You are encouraged
to adapt and override them to your project's requirements.

This addon provides a ``default`` template for all instances. You can provide
additional template choices by adding a ``DJANGOCMS_PICTURE_TEMPLATES``
setting::

    DJANGOCMS_PICTURE_TEMPLATES = [
        ('background', _('Background image')),
    ]

You'll need to create the `background` folder inside ``templates/djangocms_picture/``
otherwise you will get a *template does not exist* error. You can do this by
copying the ``default`` folder inside that directory and renaming it to
``background``.

Another setting is ``DJANGOCMS_PICTURE_NESTING``, which allows you to render an image
as the background image of a container that also contains other content (text, icons
and so on). ::

    DJANGOCMS_PICTURE_NESTING = True

will enable this (the default is ``False``). When set to ``True``, you'll be able to place additional
plugins inside the picture plugin.

You can override alignment styles with ``DJANGOCMS_PICTURE_ALIGN``, for example::

    DJANGOCMS_PICTURE_ALIGN = [
        ('top', _('Top Aligned')),
    ]

This will generate a class prefixed with ``align-``. The example above
would produce a ``class="align-top"``. Adding a ``class`` key to the image
attributes automatically merges the alignment with the attribute class.

You can enable responsive images technique by setting``DJANGOCMS_PICTURE_RESPONSIVE_IMAGES`` to ``True``.
In this case uploaded images will create thumbnails of different sizes according
to ``DJANGOCMS_PICTURE_RESPONSIVE_IMAGES_VIEWPORT_BREAKPOINTS`` (which defaults to ``[576, 768, 992]``) and browser
will be responsible for choosing the best image to display (based upon the screen viewport).

You can use ``DJANGOCMS_PICTURE_RATIO`` to set the width/height ratio of images
if these values are not set explicitly on the image::

    DJANGOCMS_PICTURE_RATIO = 1.618

We use the `golden ratio <https://en.wikipedia.org/wiki/golden_ratio>`_,
approximately 1.618, as a default value for this.

When working out sizes for the image, the system will use the following values,
of preference:

* the width or height set in the *Thumbnail options*
* *Autoscale*
* the *Width* and *Height*

We recommend setting width or height values around a placeholder so
when the plugin uses *Autoscale* it can discover them::

    {% with 720 as width and 480 as height %}
        {% placeholder content %}
    {% endwith %}

Further configuration can be achieved through the
`django Filer settings <https://django-filer.readthedocs.io/en/latest/settings.html>`_.


Running Tests
-------------

You can run tests by executing::

    virtualenv env
    source env/bin/activate
    pip install -r test_requirements/base.txt
    python setup.py test


.. |pypi| image:: https://badge.fury.io/py/djangocms-picture.svg
    :target: http://badge.fury.io/py/djangocms-picture
.. |build| image:: https://travis-ci.org/divio/djangocms-picture.svg?branch=master
    :target: https://travis-ci.org/divio/djangocms-picture
.. |coverage| image:: https://codecov.io/gh/divio/djangocms-picture/branch/master/graph/badge.svg
    :target: https://codecov.io/gh/divio/djangocms-picture

.. |python| image:: https://img.shields.io/badge/python-3.5+-blue.svg
    :target: https://pypi.org/project/djangocms-picture/
.. |django| image:: https://img.shields.io/badge/django-2.2,%203.0,%203.1-blue.svg
    :target: https://www.djangoproject.com/
.. |djangocms| image:: https://img.shields.io/badge/django%20CMS-3.7%2B-blue.svg
    :target: https://www.django-cms.org/


Updating from `cmsplugin-filer <https://github.com/django-cms/cmsplugin-filer>`_
--------------------------------------------------------------------------------

Historically, `cmsplugin-filer` was used to create file, folder, image, link, teaser & video plugins on your django CMS projects. Now `cmsplugin-filer` has been archived, you can still migrate your old instances without having to copy them manually to the new `djangocms-<file|picture|link|...>` plugins.

There's a third-party management command that supports your migration:

`migrate_cmsplugin_filer.py <https://gist.github.com/corentinbettiol/84a6ea7e4d047fc01861b0af15fd60f0>`_

This management command is only a starting point. It *has* worked out of the box for some people, but we encourage you to read the code, understand what it does, and test it on a development environment before running it on your production server.

The management command is only configured to transfer your `cmsplugin_link`, `cmsplugin_file`, `cmsplugin_folder` and `cmsplugin_image` plugins to modern `djangocms_*` plugins. If you need to transfer other `cmsplugin_*` plugins, you'll have to write your own code.

Alternatively you can use the `deprecate_cmsplugin_filer <https://github.com/ImaginaryLandscape/deprecate_cmsplugin_filer>`_ app, which only adds a small migration that transfer the old `cmsplugin-filer` plugins instances to the new `djangocms-<file|picture|link|...>` plugins.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/django-cms/djangocms-picture",
    "name": "djangocms-picture",
    "maintainer": "Django CMS Association and contributors",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "info@django-cms.org",
    "keywords": "",
    "author": "Divio AG",
    "author_email": "info@divio.ch",
    "download_url": "https://files.pythonhosted.org/packages/ef/5e/f919a910b640e9d22fd56b1537ebe8cb1b92dc01acfcb8e460a5aed84bdf/djangocms-picture-4.1.1.tar.gz",
    "platform": null,
    "description": "==================\ndjango CMS Picture\n==================\n\n|pypi| |build| |coverage|\n\n**django CMS Picture** is a plugin for `django CMS <http://django-cms.org>`_\nthat allows you to add images on your site.\n\n.. note::\n\n        This project is endorsed by the `django CMS Association <https://www.django-cms.org/en/about-us/>`_.\n        That means that it is officially accepted by the dCA as being in line with our roadmap vision and development/plugin policy.\n        Join us on `Slack <https://www.django-cms.org/slack/>`_.\n\n.. image:: preview.gif\n\n\n\n*******************************************\nContribute to this project and win rewards\n*******************************************\n\nBecause this is a an open-source project, we welcome everyone to\n`get involved in the project <https://www.django-cms.org/en/contribute/>`_ and\n`receive a reward <https://www.django-cms.org/en/bounty-program/>`_ for their contribution.\nBecome part of a fantastic community and help us make django CMS the best CMS in the world.\n\nWe'll be delighted to receive your\nfeedback in the form of issues and pull requests. Before submitting your\npull request, please review our `contribution guidelines\n<http://docs.django-cms.org/en/latest/contributing/index.html>`_.\n\nWe're grateful to all contributors who have helped create and maintain this package.\nContributors are listed at the `contributors <https://github.com/django-cms/djangocms-picture/graphs/contributors>`_\nsection.\n\nDocumentation\n=============\n\nSee ``REQUIREMENTS`` in the `setup.py <https://github.com/divio/djangocms-picture/blob/master/setup.py>`_\nfile for additional dependencies:\n\n|python| |django| |djangocms|\n\n* Django Filer 1.7 or higher\n\nMake sure `django-filer <http://django-filer.readthedocs.io/en/latest/installation.html>`_\nis installed and configured appropriately.\n\n\nInstallation\n------------\n\nFor a manual install:\n\n* run ``pip install djangocms-picture``\n* add ``djangocms_picture`` to your ``INSTALLED_APPS``\n* run ``python manage.py migrate djangocms_picture``\n\n\nConfiguration\n-------------\n\nNote that the provided templates are very minimal by design. You are encouraged\nto adapt and override them to your project's requirements.\n\nThis addon provides a ``default`` template for all instances. You can provide\nadditional template choices by adding a ``DJANGOCMS_PICTURE_TEMPLATES``\nsetting::\n\n    DJANGOCMS_PICTURE_TEMPLATES = [\n        ('background', _('Background image')),\n    ]\n\nYou'll need to create the `background` folder inside ``templates/djangocms_picture/``\notherwise you will get a *template does not exist* error. You can do this by\ncopying the ``default`` folder inside that directory and renaming it to\n``background``.\n\nAnother setting is ``DJANGOCMS_PICTURE_NESTING``, which allows you to render an image\nas the background image of a container that also contains other content (text, icons\nand so on). ::\n\n    DJANGOCMS_PICTURE_NESTING = True\n\nwill enable this (the default is ``False``). When set to ``True``, you'll be able to place additional\nplugins inside the picture plugin.\n\nYou can override alignment styles with ``DJANGOCMS_PICTURE_ALIGN``, for example::\n\n    DJANGOCMS_PICTURE_ALIGN = [\n        ('top', _('Top Aligned')),\n    ]\n\nThis will generate a class prefixed with ``align-``. The example above\nwould produce a ``class=\"align-top\"``. Adding a ``class`` key to the image\nattributes automatically merges the alignment with the attribute class.\n\nYou can enable responsive images technique by setting``DJANGOCMS_PICTURE_RESPONSIVE_IMAGES`` to ``True``.\nIn this case uploaded images will create thumbnails of different sizes according\nto ``DJANGOCMS_PICTURE_RESPONSIVE_IMAGES_VIEWPORT_BREAKPOINTS`` (which defaults to ``[576, 768, 992]``) and browser\nwill be responsible for choosing the best image to display (based upon the screen viewport).\n\nYou can use ``DJANGOCMS_PICTURE_RATIO`` to set the width/height ratio of images\nif these values are not set explicitly on the image::\n\n    DJANGOCMS_PICTURE_RATIO = 1.618\n\nWe use the `golden ratio <https://en.wikipedia.org/wiki/golden_ratio>`_,\napproximately 1.618, as a default value for this.\n\nWhen working out sizes for the image, the system will use the following values,\nof preference:\n\n* the width or height set in the *Thumbnail options*\n* *Autoscale*\n* the *Width* and *Height*\n\nWe recommend setting width or height values around a placeholder so\nwhen the plugin uses *Autoscale* it can discover them::\n\n    {% with 720 as width and 480 as height %}\n        {% placeholder content %}\n    {% endwith %}\n\nFurther configuration can be achieved through the\n`django Filer settings <https://django-filer.readthedocs.io/en/latest/settings.html>`_.\n\n\nRunning Tests\n-------------\n\nYou can run tests by executing::\n\n    virtualenv env\n    source env/bin/activate\n    pip install -r test_requirements/base.txt\n    python setup.py test\n\n\n.. |pypi| image:: https://badge.fury.io/py/djangocms-picture.svg\n    :target: http://badge.fury.io/py/djangocms-picture\n.. |build| image:: https://travis-ci.org/divio/djangocms-picture.svg?branch=master\n    :target: https://travis-ci.org/divio/djangocms-picture\n.. |coverage| image:: https://codecov.io/gh/divio/djangocms-picture/branch/master/graph/badge.svg\n    :target: https://codecov.io/gh/divio/djangocms-picture\n\n.. |python| image:: https://img.shields.io/badge/python-3.5+-blue.svg\n    :target: https://pypi.org/project/djangocms-picture/\n.. |django| image:: https://img.shields.io/badge/django-2.2,%203.0,%203.1-blue.svg\n    :target: https://www.djangoproject.com/\n.. |djangocms| image:: https://img.shields.io/badge/django%20CMS-3.7%2B-blue.svg\n    :target: https://www.django-cms.org/\n\n\nUpdating from `cmsplugin-filer <https://github.com/django-cms/cmsplugin-filer>`_\n--------------------------------------------------------------------------------\n\nHistorically, `cmsplugin-filer` was used to create file, folder, image, link, teaser & video plugins on your django CMS projects. Now `cmsplugin-filer` has been archived, you can still migrate your old instances without having to copy them manually to the new `djangocms-<file|picture|link|...>` plugins.\n\nThere's a third-party management command that supports your migration:\n\n`migrate_cmsplugin_filer.py <https://gist.github.com/corentinbettiol/84a6ea7e4d047fc01861b0af15fd60f0>`_\n\nThis management command is only a starting point. It *has* worked out of the box for some people, but we encourage you to read the code, understand what it does, and test it on a development environment before running it on your production server.\n\nThe management command is only configured to transfer your `cmsplugin_link`, `cmsplugin_file`, `cmsplugin_folder` and `cmsplugin_image` plugins to modern `djangocms_*` plugins. If you need to transfer other `cmsplugin_*` plugins, you'll have to write your own code.\n\nAlternatively you can use the `deprecate_cmsplugin_filer <https://github.com/ImaginaryLandscape/deprecate_cmsplugin_filer>`_ app, which only adds a small migration that transfer the old `cmsplugin-filer` plugins instances to the new `djangocms-<file|picture|link|...>` plugins.\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "Adds an image plugin to django CMS",
    "version": "4.1.1",
    "project_urls": {
        "Homepage": "https://github.com/django-cms/djangocms-picture"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8c80e2baa53109272b856c87f5965eb4e29a4ddc7ff4f50bd3b13d12c762f31f",
                "md5": "f8454348c173914db4ad8a258bc025e1",
                "sha256": "d5a568f7bbbed7f9af3c7eb4901ec95b94ccdbc16b3debf52ae98f2ec6920671"
            },
            "downloads": -1,
            "filename": "djangocms_picture-4.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f8454348c173914db4ad8a258bc025e1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 347613,
            "upload_time": "2023-10-19T15:34:20",
            "upload_time_iso_8601": "2023-10-19T15:34:20.853991Z",
            "url": "https://files.pythonhosted.org/packages/8c/80/e2baa53109272b856c87f5965eb4e29a4ddc7ff4f50bd3b13d12c762f31f/djangocms_picture-4.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ef5ef919a910b640e9d22fd56b1537ebe8cb1b92dc01acfcb8e460a5aed84bdf",
                "md5": "709c0c494216addfd7d4205819d53ff7",
                "sha256": "29ffadc514bfa306ec1f2ebb145391b9b860c12ba001e2475dffb5fe1be5cac2"
            },
            "downloads": -1,
            "filename": "djangocms-picture-4.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "709c0c494216addfd7d4205819d53ff7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 67783,
            "upload_time": "2023-10-19T15:34:23",
            "upload_time_iso_8601": "2023-10-19T15:34:23.186856Z",
            "url": "https://files.pythonhosted.org/packages/ef/5e/f919a910b640e9d22fd56b1537ebe8cb1b92dc01acfcb8e460a5aed84bdf/djangocms-picture-4.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-19 15:34:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "django-cms",
    "github_project": "djangocms-picture",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "tox": true,
    "lcname": "djangocms-picture"
}
        
Elapsed time: 0.14177s