Package: djangocms-picture
django CMS Pictureis a plugin fordjango CMSthat allows you to add images on your site.NoteThis project is endorsed by thedjango CMS Association.
That means that it is officially accepted by the dCA as being in line with our roadmap vision and development/plugin policy.
Join us onSlack.Contribute to this project and win rewardsBecause this is a an open-source project, we welcome everyone toget involved in the projectandreceive a rewardfor 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 ourcontribution guidelines.We’re grateful to all contributors who have helped create and maintain this package.
Contributors are listed at thecontributorssection.DocumentationSeeREQUIREMENTSin thesetup.pyfile for additional dependencies:Django Filer 1.7 or higherMake suredjango-fileris installed and configured appropriately.InstallationFor a manual install:runpip installdjangocms-pictureadddjangocms_pictureto yourINSTALLED_APPSrunpython manage.py migrate djangocms_pictureConfigurationNote 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 adefaulttemplate for all instances. You can provide
additional template choices by adding aDJANGOCMS_PICTURE_TEMPLATESsetting:DJANGOCMS_PICTURE_TEMPLATES = [
    ('background', _('Background image')),
]You’ll need to create thebackgroundfolder insidetemplates/djangocms_picture/otherwise you will get atemplate does not existerror. You can do this by
copying thedefaultfolder inside that directory and renaming it tobackground.Another setting isDJANGOCMS_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 = Truewill enable this (the default isFalse). When set toTrue, you’ll be able to place additional
plugins inside the picture plugin.You can override alignment styles withDJANGOCMS_PICTURE_ALIGN, for example:DJANGOCMS_PICTURE_ALIGN = [
    ('top', _('Top Aligned')),
]This will generate a class prefixed withalign-. The example above
would produce aclass="align-top". Adding aclasskey to the image
attributes automatically merges the alignment with the attribute class.You can enable responsive images technique by setting``DJANGOCMS_PICTURE_RESPONSIVE_IMAGES`` toTrue.
In this case uploaded images will create thumbnails of different sizes according
toDJANGOCMS_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 useDJANGOCMS_PICTURE_RATIOto set the width/height ratio of images
if these values are not set explicitly on the image:DJANGOCMS_PICTURE_RATIO = 1.618We use thegolden 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 theThumbnail optionsAutoscaletheWidthandHeightWe recommend setting width or height values around a placeholder so
when the plugin usesAutoscaleit can discover them:{% with 720 as width and 480 as height %}
    {% placeholder content %}
{% endwith %}Further configuration can be achieved through thedjango Filer settings.Running TestsYou can run tests by executing:virtualenv env
source env/bin/activate
pip install -r test_requirements/base.txt
python setup.py testUpdating fromcmsplugin-filerHistorically,cmsplugin-filerwas used to create file, folder, image, link, teaser & video plugins on your django CMS projects. Nowcmsplugin-filerhas been archived, you can still migrate your old instances without having to copy them manually to the newdjangocms-<file|picture|link|…>plugins.There’s a third-party management command that supports your migration:migrate_cmsplugin_filer.pyThis management command is only a starting point. Ithasworked 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 yourcmsplugin_link,cmsplugin_file,cmsplugin_folderandcmsplugin_imageplugins to moderndjangocms_*plugins. If you need to transfer othercmsplugin_*plugins, you’ll have to write your own code.Alternatively you can use thedeprecate_cmsplugin_filerapp, which only adds a small migration that transfer the oldcmsplugin-filerplugins instances to the newdjangocms-<file|picture|link|…>plugins.