{ "info": { "author": "Taras Gaidukov", "author_email": "kemaweyan@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django :: 1.10", "Framework :: Django :: 1.11", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "django-content-gallery\n======================\n\n.. image:: https://travis-ci.org/Kemaweyan/django-content-gallery.svg?branch=master\n :target: https://travis-ci.org/Kemaweyan/django-content-gallery\n.. image:: https://coveralls.io/repos/github/Kemaweyan/django-content-gallery/badge.svg?branch=master\n :target: https://coveralls.io/github/Kemaweyan/django-content-gallery?branch=master\n\n**django-content-gallery** is a Django application that allows to attach a collection\nof images to objects of any models in you Django projects. It also allows you easily\nadd and remove images, re-attach images to another object (i.e. move an image to another\ncollection) and change an order of images in the collection as well.\n\nThe **django-content-gallery** creates 5 images with different sizes for each uploaded image:\n\n* a large image viewed in the gallery for users with high-resulution displays\n* a small image viewed in the gallery for users with low-resulution displays\n* a large preview image used in a preview\n* a small preview image used in a small preview\n* a thumbnail viewed in the list of available images\n\n\nRequirements\n============\n\n* **Python** 3.4+\n* **Django** 1.10+\n* **Pillow** 3.0.0+\n* **python-magic** 0.4.2+\n* **awesome-slugify** 1.6+\n* **django-admin-jqueryui112** 1.12.1+\n\n.. NOTE::\n\tWindows users should also copy ``magic1.dll``, ``regex2.dll`` and ``zlib1.dll`` onto\n\tthe PATH. These libraries are required by the **python-magic** package and could be\n\tdownloaded on the `File for Windows `_\n\tofficial page.\n\n\nInstallation\n============\n\nTo install the **django-content-gallery** type following command:\n\n.. code-block::\n\n $ pip install django-content-gallery\n\nThen add the ``content_gallery`` to INSTALLED_APPS in the settings of your project and the\n``admin_jqueryui`` to enable sorting images in the admin panel:\n\n.. code-block::\n\n INSTALLED_APPS = [\n ...\n 'content_gallery',\n 'admin_jqueryui',\n ]\n\nAdd the ``content_gallery.urls`` to the urls.py of your project (you could use any\nURL pattern, not only ``^content_gallery\\``):\n\n.. code-block::\n\n urlpatterns = [\n ...\n url(r'^content_gallery/', include('content_gallery.urls')),\n ]\n\nCreate tables in the database using the ``migrate`` command:\n\n.. code-block::\n\n $ python manage.py migrate content_gallery\n\nNow the **django-content-gallery** is ready for use!\n\n\nConfiguration\n=============\n\nTo change settings of the **django-content-gallery** set the ``CONTENT_GALLERY`` dict\nin your ``settings.py`` module. The dict could contain following items:\n\n* **image_width** - the target width of the large image\n* **image_height** - the target height of the large image\n\n* **small_image_width** - the target width of the small image\n* **small_image_height** - the target height of the small image\n\n* **thumbnail_width** - the target width of the thumbnail\n* **thumbnail_height** - the target height of the thumbnail\n\n* **preview_width** - the target width of the large preview\n* **preview_height** - the target height of the large preview\n\n* **small_preview_width** - the target width of the small preview\n* **small_preview_height** - the target height of the small preview\n\n* **path** - the subdirectory in the ``MEDIA_ROOT`` where image files would be stored\n\nDefault values of these settings are\n\n* **image_width** = 752\n* **image_height** = 608\n* **small_image_width** = 564\n* **small_image_height** = 456\n* **thumbnail_width** = 94\n* **thumbnail_height** = 76\n* **preview_width** = 376\n* **preview_height** = 304\n* **small_preview_width** = 141\n* **small_preview_height** =114\n* **path** = 'content_gallery'\n\nYou could change some of these settings and keep the rest undefined in you ``settings.py``,\nin this case the default values would be used instead:\n\n.. code-block::\n\n\tCONTENT_GALLERY = {\n\t\t\"image_width\": 1024,\n\t\t\"image_height\": 768,\n\t}\n\nThis code changes size of the large image only, the rest of settings values would be default.\n\nUsage\n=====\n\nTo make your models able to attach a gallery, use the ``ContentGalleryMixin`` in\nmodels you want to use the content-gallery with:\n\n.. code-block::\n\n from django.db import models\n from content_gallery.models import ContentGalleryMixin\n\n class YourModel(ContentGalleryMixin, models.Model):\n ...\n\nAlso to be able to edit attached image collection on the admin page of your model,\nyou need to add the ``ImageAdminInline`` to inlines of your model admin. Add following\ncode to your admin.py\n\n.. code-block::\n\n from django.contrib import admin\n from content_gallery.admin import ImageAdminInline\n from . import models\n\n class YourModelAdmin(admin.ModelAdmin):\n inlines = [\n ImageAdminInline,\n ]\n\n admin.site.register(models.YourModel, YourModelAdmin)\n\nNow the **django-content-gallery** is available for your models. Then you need to add the\ncontent-gallery to your pages.\n\nFirst of all add the ``content_gallery/_image_view.html`` template to your templates where you\nwant the content-gallery to be available:\n\n.. code-block::\n\n {% include \"content_gallery/_image_view.html\" %}\n\nThe **django-content-gallery** uses jQuery within its scripts, so make sure that jQuery is\navailable on your pages where the content-gallery is used.\n\nTo add the gallery related to your objects onto your pages the **django-content-gallery** provides\ntwo template tags. Those template tags are located in the ``content_gallery`` template tag set, so\nbefore use them you should load this set:\n\n.. code-block::\n\n\t{% load content_gallery %}\n\nThe first template tag named ``gallery_preview`` adds the large preview. It uses one argument which\nis your object. This tag is meant to be used generally in templates of detail views:\n\n.. code-block::\n\n\t{% gallery_preview your_object %}\n\nThis code adds the preview widget that shows a preview of the first image related to the object.\n \nThe ``gallery_small_preview`` tag adds a small preview onto the page, it uses such object as an\nargument as well, and is meant to be used generally in templates of list views:\n\n.. code-block::\n\n\t{% gallery_small_preview your_object %}\n\nThis code adds the small preview widget that shows a small preview of the first image related\nto the object.\n\nAlso the **django-content-gallery** provides a simple template tag named ``gallery_image_data``\nthat also gets an object as an argument and returns a dict object that contains an object of\nthe first image and JSON data for constructing a link to the object. You could use this template\ntag to construct you own custom widgets.\n\nFor more details, see the **content_gallery_testapp** which is an example of\nthe **django-content-gallery** usage.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Kemaweyan/django-content-gallery", "keywords": "django image gallery photo", "license": "BSD-3-Clause", "maintainer": "", "maintainer_email": "", "name": "django-content-gallery", "package_url": "https://pypi.org/project/django-content-gallery/", "platform": "", "project_url": "https://pypi.org/project/django-content-gallery/", "project_urls": { "Homepage": "https://github.com/Kemaweyan/django-content-gallery" }, "release_url": "https://pypi.org/project/django-content-gallery/1.0.0b1/", "requires_dist": null, "requires_python": "", "summary": " The Django application allows to attach a collection of images to objects of any model of any app", "version": "1.0.0b1" }, "last_serial": 2992596, "releases": { "1.0.0b1": [ { "comment_text": "", "digests": { "md5": "a0b3702094e644943c05a40bd19e0f62", "sha256": "094df9b8dd966b3738517203d6387e5bfb63553000b45559c042dd457ed9934b" }, "downloads": -1, "filename": "django_content_gallery-1.0.0b1-py3-none-any.whl", "has_sig": false, "md5_digest": "a0b3702094e644943c05a40bd19e0f62", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 100572, "upload_time": "2017-07-01T15:43:22", "url": "https://files.pythonhosted.org/packages/8a/bc/a53458db2482c3e4d92e3e16f3f620ddfb60d2a1651cf5c4a82ab4cd8625/django_content_gallery-1.0.0b1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7164a79ab11878ce5370e71b29f15bca", "sha256": "20d66f81344e4d873af1d08ba7be6ef6278dbde1753c71d01d70c3d71fd67971" }, "downloads": -1, "filename": "django-content-gallery-1.0.0b1.tar.gz", "has_sig": false, "md5_digest": "7164a79ab11878ce5370e71b29f15bca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 82464, "upload_time": "2017-07-01T15:22:30", "url": "https://files.pythonhosted.org/packages/3d/c5/63987cffeac6626757c0cfad83beed928a0f4c40067edf72d0210ea80b96/django-content-gallery-1.0.0b1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a0b3702094e644943c05a40bd19e0f62", "sha256": "094df9b8dd966b3738517203d6387e5bfb63553000b45559c042dd457ed9934b" }, "downloads": -1, "filename": "django_content_gallery-1.0.0b1-py3-none-any.whl", "has_sig": false, "md5_digest": "a0b3702094e644943c05a40bd19e0f62", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 100572, "upload_time": "2017-07-01T15:43:22", "url": "https://files.pythonhosted.org/packages/8a/bc/a53458db2482c3e4d92e3e16f3f620ddfb60d2a1651cf5c4a82ab4cd8625/django_content_gallery-1.0.0b1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7164a79ab11878ce5370e71b29f15bca", "sha256": "20d66f81344e4d873af1d08ba7be6ef6278dbde1753c71d01d70c3d71fd67971" }, "downloads": -1, "filename": "django-content-gallery-1.0.0b1.tar.gz", "has_sig": false, "md5_digest": "7164a79ab11878ce5370e71b29f15bca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 82464, "upload_time": "2017-07-01T15:22:30", "url": "https://files.pythonhosted.org/packages/3d/c5/63987cffeac6626757c0cfad83beed928a0f4c40067edf72d0210ea80b96/django-content-gallery-1.0.0b1.tar.gz" } ] }