{"id":13774656,"url":"https://github.com/django-cms/djangocms-picture","last_synced_at":"2025-04-06T02:09:34.804Z","repository":{"id":13816480,"uuid":"16512910","full_name":"django-cms/djangocms-picture","owner":"django-cms","description":"django CMS Picture is a plugin for django CMS that allows you to add images on your site.","archived":false,"fork":false,"pushed_at":"2024-01-22T22:07:09.000Z","size":829,"stargazers_count":47,"open_issues_count":13,"forks_count":60,"subscribers_count":27,"default_branch":"master","last_synced_at":"2024-05-01T11:40:20.709Z","etag":null,"topics":["addon","cms","django","django-cms","python"],"latest_commit_sha":null,"homepage":"https://www.django-cms.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/django-cms.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2014-02-04T13:45:28.000Z","updated_at":"2024-01-17T18:17:10.000Z","dependencies_parsed_at":"2023-01-13T17:38:17.027Z","dependency_job_id":"2b391e63-46f1-4547-87c7-b3b5157d61f4","html_url":"https://github.com/django-cms/djangocms-picture","commit_stats":{"total_commits":158,"total_committers":30,"mean_commits":5.266666666666667,"dds":"0.43670886075949367","last_synced_commit":"0923e61c29262fe5131a07da2f5eece77a6e95d4"},"previous_names":["divio/djangocms-picture"],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/django-cms%2Fdjangocms-picture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/django-cms%2Fdjangocms-picture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/django-cms%2Fdjangocms-picture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/django-cms%2Fdjangocms-picture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/django-cms","download_url":"https://codeload.github.com/django-cms/djangocms-picture/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423515,"owners_count":20936626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["addon","cms","django","django-cms","python"],"created_at":"2024-08-03T17:01:29.044Z","updated_at":"2025-04-06T02:09:34.788Z","avatar_url":"https://github.com/django-cms.png","language":"Python","funding_links":[],"categories":["Add-ons"],"sub_categories":[],"readme":"==================\ndjango CMS Picture\n==================\n\n|pypi| |build| |coverage|\n\n**django CMS Picture** is a plugin for `django CMS \u003chttp://django-cms.org\u003e`_\nthat allows you to add images on your site.\n\n.. note::\n\n        This project is endorsed by the `django CMS Association \u003chttps://www.django-cms.org/en/about-us/\u003e`_.\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 \u003chttps://www.django-cms.org/slack/\u003e`_.\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 \u003chttps://www.django-cms.org/en/contribute/\u003e`_ and\n`receive a reward \u003chttps://www.django-cms.org/en/bounty-program/\u003e`_ 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\u003chttp://docs.django-cms.org/en/latest/contributing/index.html\u003e`_.\n\nWe're grateful to all contributors who have helped create and maintain this package.\nContributors are listed at the `contributors \u003chttps://github.com/django-cms/djangocms-picture/graphs/contributors\u003e`_\nsection.\n\nDocumentation\n=============\n\nSee ``REQUIREMENTS`` in the `setup.py \u003chttps://github.com/divio/djangocms-picture/blob/master/setup.py\u003e`_\nfile for additional dependencies:\n\n|python| |django| |djangocms|\n\n* Django Filer 1.7 or higher\n\nMake sure `django-filer \u003chttp://django-filer.readthedocs.io/en/latest/installation.html\u003e`_\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\nWhen using the ``DJANGOCMS_PICTURE_ALIGN`` setting, you have the flexibility to align images in various styles, such as left, right, or center, as well as to float images and vertically align them. You can customize these alignment options as follows::\n\n    DJANGOCMS_PICTURE_ALIGN = [        \n        ('left', _('Align left')),\n        ('right', _('Align right')),\n        ('center', _('Align center')),\n        # Image float alignment options\n        (\"start\", _(\"Float left\")),            \n        (\"end\", _(\"Float right\")),\n        # Vertical alignment options\n        ('top', _('Align top')),\n        ('middle', _('Align middle')),\n        ('bottom', _('Align Bottom')),\n        ('baseline', _('Align baseline')),           \n    ]\n\nThis configuration will generate a CSS class prefixed with ``align-``. For example, when selecting the left align option, it will produce a class attribute like ``class=\"align-left\"`` for the image. You can apply these classes to your image attributes, and they will automatically handle the alignment.\n\nThese alignment options are consistent with `Bootstrap's image alignment styles \u003chttps://getbootstrap.com/docs/5.3/content/images/#aligning-images\u003e`_, however, **you have to provide your own CSS styles for the alignment options**, be it through Bootstrap or otherwise.\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 \u003chttps://en.wikipedia.org/wiki/golden_ratio\u003e`_,\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 \u003chttps://django-filer.readthedocs.io/en/latest/settings.html\u003e`_.\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 \u003chttps://github.com/django-cms/cmsplugin-filer\u003e`_\n--------------------------------------------------------------------------------\n\nHistorically, `cmsplugin-filer` was used to create file, folder, image, link, teaser \u0026 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-\u003cfile|picture|link|...\u003e` plugins.\n\nThere's a third-party management command that supports your migration:\n\n`migrate_cmsplugin_filer.py \u003chttps://gist.github.com/corentinbettiol/84a6ea7e4d047fc01861b0af15fd60f0\u003e`_\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 \u003chttps://github.com/ImaginaryLandscape/deprecate_cmsplugin_filer\u003e`_ app, which only adds a small migration that transfer the old `cmsplugin-filer` plugins instances to the new `djangocms-\u003cfile|picture|link|...\u003e` plugins.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjango-cms%2Fdjangocms-picture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdjango-cms%2Fdjangocms-picture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjango-cms%2Fdjangocms-picture/lists"}