{ "info": { "author": "Zeynel", "author_email": "", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6" ], "description": "==================\ndjango-media-tools\n==================\n\ndjango-media-tools is an app that provides useful widgets for managing media files in django admin. It doesn't use any javascript library.\n\nWorks with Django 1.10 and newer versions.\n\nInstallation\n============\n\n#. Install using pip::\n\n pip install django-media-tools\n\n#. Add ``media_tools`` to the ``INSTALLED_APPS``::\n\n INSTALLED_APPS = [\n ...\n 'media_tools',\n ]\n\n#. Run ``collectstatic`` command. It will copy the static files used by media_tools to your static root.::\n\n python manage.py collectstatic\n\n\nPreviewImageWidget\n==================\n\nPreviewImageWidget is a fairly simple widget that you can use for previewing an ``ImageField``.\nThe image-box is located at left of the Browse button as you can see below. If you click the image-box you will notice that the image will be open in a modal-box with a bigger size.\n\n**image-box**: preview of the image\n\n**modal-box**: it pops up when you click on the image-box\n\n.. image:: https://screenshotscdn.firefoxusercontent.com/images/c7cce7f5-cfe6-4de0-9d1b-1dc9529c87f4.png\n\n**Settings for PreviewImageWidget**\n\nAdd ``DJANGO_MEDIA_TOOLS_CONFIG`` to your ``settings.py`` file if you want to set defaults for PreviewImageWidget. ::\n\n DJANGO_MEDIA_TOOLS_CONFIG = {\n # max sizes of preview image-box\n 'preview_max_height': '150px',\n 'preview_max_width': '150px',\n\n # max size of preview modal-box (the box that is opened when clicked on image)\n 'preview_modal_max_height': '90%',\n 'preview_modal_max_width': '90%',\n\n # Hides 'currently' label on admin\n 'hide_currently': False,\n\n # Shows the image url at the bottom of the modal if set to True\n 'show_caption': True\n }\n\n**How to use PreviewImageWidget**\n\nsample *models.py* ::\n\n class Product(models.Model):\n name = models.CharField(_('name'), max_length=50)\n photo = models.ImageField(_('Photo'), upload_to='testing/product', blank=True)\n banner = models.ImageField(_('Banner'), upload_to='testing/product', blank=True)\n\n\nsample *forms.py* ::\n\n from media_tools.widgets import ImagePreviewWidget\n from .models import Product\n\n class ProductForm(forms.ModelForm):\n class Meta:\n model = Product\n fields = '__all__'\n widgets = {\n 'photo': ImagePreviewWidget(preview_max_height='80px', preview_modal_max_height='600px', hide_currently=True, ),\n 'banner': ImagePreviewWidget(preview_max_width='150px', preview_modal_max_width='50%', show_caption=False),\n }\n\nAs you can see you can override the default settings by giving them as kwargs.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/zeyneloz/django-media-tools", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "django-media-tools", "package_url": "https://pypi.org/project/django-media-tools/", "platform": "", "project_url": "https://pypi.org/project/django-media-tools/", "project_urls": { "Homepage": "https://github.com/zeyneloz/django-media-tools" }, "release_url": "https://pypi.org/project/django-media-tools/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "A Django app that provides widgets for media files", "version": "0.1.0" }, "last_serial": 3668669, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "6f140ab04225c7046558e68cc520333c", "sha256": "de53b3d5ba7105c17ac7c78ba621283cf4ea418178e2a7b80d228f54fe89a6f3" }, "downloads": -1, "filename": "django-media-tools-0.1.0.tar.gz", "has_sig": false, "md5_digest": "6f140ab04225c7046558e68cc520333c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5380, "upload_time": "2018-03-14T12:29:06", "url": "https://files.pythonhosted.org/packages/1c/41/0d5e0a257b61ea85954fc5b3ddf202df3cbec1b75027fedfcae918126bfd/django-media-tools-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6f140ab04225c7046558e68cc520333c", "sha256": "de53b3d5ba7105c17ac7c78ba621283cf4ea418178e2a7b80d228f54fe89a6f3" }, "downloads": -1, "filename": "django-media-tools-0.1.0.tar.gz", "has_sig": false, "md5_digest": "6f140ab04225c7046558e68cc520333c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5380, "upload_time": "2018-03-14T12:29:06", "url": "https://files.pythonhosted.org/packages/1c/41/0d5e0a257b61ea85954fc5b3ddf202df3cbec1b75027fedfcae918126bfd/django-media-tools-0.1.0.tar.gz" } ] }