{ "info": { "author": "Nick Mavrakis", "author_email": "mavrakis.n@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 2.0", "Framework :: Django :: 2.1", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.6" ], "description": "Progressive Image Model Field for Django\n----------------------------------------\n\nRequires:\n\n- Python 3.6+\n- Pillow 4.0+\n- Django 2.0+\n\n*The Problem*: So, you have build a website (portfolio, news, eshop\netc), you have optimized your static files (css, js, fonts, images) but\nstill, the webpage loads quite slow due to lots of images being rendered\n(however, there might be other reasons, but right now, let\u2019s focus on\nthe image rendering).\n\n*The Solution*: Based on `Jos\u00e9 Manuel\nP\u00e9rez `__\\ \u2019s article about `How\nMedium does progressive image\nloading `__,\nI have created a Django ModelField, which I called\n``ProgressiveImageField``. All it does is this: when an instance\u2019s\nprogressiveimagefield is created (saved, most commonly via the admin\ninterface), it automatically creates a very small blurred thumbnail\n(maximum dimensions ``10x10px``) next to the original image. When this\nlarge image is rendered, the ``src`` attribute of the ``img`` element\npoints to the thumbnail and not the large image. So, the user,\ninitially, sees the blurred thumbnail. Behind the scenes, javascript\ntakes place and gradually downloads the original image. Once the\noriginal image is downloaded, the blurred thumbnail is replaced through\na nice-looking-CSS-fade effect. That\u2019s all!\n\n\nInstallation\n------------\n\n1. Install it using pip:\n\n ``pip install django-progressiveimagefield``\n\n2. Add it to your ``INSTALLED_APPS`` inside your ``settings`` file:\n\n ``INSTALLED_APPS += ['progressiveimagefield']``\n\n\nHow to use\n----------\n\nInside your ``models.py``, simply:\n\n.. code:: python\n\n from django.db import models\n\n from progressiveimagefield.fields import ProgressiveImageField\n\n class MyModel(models.Model):\n # Other fields here\n img = ProgressiveImageField(upload_to=\"somewhere\")\n\nInside your ``base.html`` template:\n\n.. code:: html\n\n {% load static %}\n\n \n \n \n \n \n \n \n {% block content %}{% endblock %}\n \n \n \n\nFinally, inside another HTML template where you want to render your image\nprogressively, you have two options depending on which template engine is used to render your template:\n\n- Using the DTL (Django Template Language)\n\n .. code:: html\n\n {% load progressive_tags %}\n\n {% block content %}\n {% render_progressive_field instance.img %}\n {% endblock %}\n\n- Using the `Jinja2 Template Language `__\n\n 1. Add the filter inside the file (i.e ``jinja.py``) where Jinja2 Environment is defined\n\n .. code:: python\n\n from jinja2 import Environment\n\n def environment(**options):\n env = Environment(**options)\n env.filters.update({\n 'progressive': 'progressiveimagefield.jinja.progressive',\n })\n return env\n\n 2. Add the dotted path to the above function in your ``settings``'s ``TEMPLATES`` setting ``OPTIONS`` dict as the value to the ``environment`` key. OK, here is the code:\n\n .. code:: python\n\n TEMPLATES = [\n {\n 'BACKEND': 'django.template.backends.jinja2.Jinja2',\n 'DIRS': # setting for DIRS here,\n 'APP_DIRS': True,\n 'OPTIONS': {\n 'environment': 'path.to.jinja.environment.function',\n },\n },\n ...\n ]\n\n 3. Use it in your HTML template like this (just like a regular Django filter):\n\n .. code:: html\n\n {% block content %}\n {{ instance.img|progressive }}\n {% endblock %}\n\n\nTesting\n-------\n\nIn order to test this application, you should\n\n1. Clone the repo\n2. Create a virtualenv\n (``mkvirtualenv -p $(which python3.6) progressiveimagefield``) and\n activate it (once created, it\u2019ll be activated by default)\n3. Install the requirements\n (``pip install -r tests/test_requirements.txt``)\n4. Run ``python runtests.py``\n\nFurther Reading\n---------------\n\n`Page Load Optimization by Progressive Image Loading (like\nMedium) `__\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/manikos/django-progressiveimagefield", "keywords": "django progressive image field", "license": "", "maintainer": "", "maintainer_email": "", "name": "django-progressiveimagefield", "package_url": "https://pypi.org/project/django-progressiveimagefield/", "platform": "", "project_url": "https://pypi.org/project/django-progressiveimagefield/", "project_urls": { "Homepage": "https://github.com/manikos/django-progressiveimagefield" }, "release_url": "https://pypi.org/project/django-progressiveimagefield/0.1.5/", "requires_dist": [ "Django (>=2.0.11)", "Pillow (>=4.0.0)" ], "requires_python": ">=3.6", "summary": "A Django ImageField that offers progressive image loading during HTML rendering.", "version": "0.1.5" }, "last_serial": 4921782, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "16e3e68795b7da25181ce1876f6c68c5", "sha256": "fb598d85ea5aff0f719bedefacf902a6a2dec52c6a39380f48a099aa252aed87" }, "downloads": -1, "filename": "django_progressiveimagefield-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "16e3e68795b7da25181ce1876f6c68c5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 9093, "upload_time": "2018-01-13T19:36:56", "url": "https://files.pythonhosted.org/packages/bc/17/8e12c1702217438fb136b39dfeeffa7ca9a54884079be9a05e7aa8330ffe/django_progressiveimagefield-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "823e445261b0d5d84a2ddce61fb71799", "sha256": "a58ceb84e367e460851fb0d005be9c762846436cb10a2c8e5de4c1609882a9e0" }, "downloads": -1, "filename": "django-progressiveimagefield-0.1.1.tar.gz", "has_sig": false, "md5_digest": "823e445261b0d5d84a2ddce61fb71799", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 5919, "upload_time": "2018-01-13T19:36:57", "url": "https://files.pythonhosted.org/packages/5c/a4/db8d1129b7814eb94c136c2fa794851a0fbf72967bb886757f2dd58f079b/django-progressiveimagefield-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "473ba732ab5c9770045813e0e309c532", "sha256": "1c40cde7443129d5b20360cd04d4e030f1f0575df5a3363e435d66ad7591420b" }, "downloads": -1, "filename": "django_progressiveimagefield-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "473ba732ab5c9770045813e0e309c532", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 11102, "upload_time": "2018-02-03T16:31:12", "url": "https://files.pythonhosted.org/packages/90/c5/0c0d990a7e3b7b36829ac76b9540b59a2727cedfa4f3319301dccb25021e/django_progressiveimagefield-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a95ea1c88c248fbc497aa1196dbda1a1", "sha256": "3d68df1b4984e7bf4448a5803d2463c70a03e05cc18e67f81ce37fc51898a287" }, "downloads": -1, "filename": "django-progressiveimagefield-0.1.2.tar.gz", "has_sig": false, "md5_digest": "a95ea1c88c248fbc497aa1196dbda1a1", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 8152, "upload_time": "2018-02-03T16:31:14", "url": "https://files.pythonhosted.org/packages/2f/e0/647a8284f740fbcabc7b438b2359fd97dfd7861d03709168717b31416053/django-progressiveimagefield-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "71046af84804b5f0dd5614e17db219cd", "sha256": "ec293707e7d370e9e1bc08e30e0d5171384a470311c4e1bec37b58956b0b9f49" }, "downloads": -1, "filename": "django_progressiveimagefield-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "71046af84804b5f0dd5614e17db219cd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 12456, "upload_time": "2018-07-21T18:28:32", "url": "https://files.pythonhosted.org/packages/cf/b3/677d1fd59d12d48bf9a97276a28c569946fd9562519ff90a583699e13454/django_progressiveimagefield-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0b27f6f580eb61f0566acafc3c035bb0", "sha256": "c869319ab2db8c4040c8fceda1ba2569ad6be4f695e20bea45fef098c4f70bbc" }, "downloads": -1, "filename": "django-progressiveimagefield-0.1.3.tar.gz", "has_sig": false, "md5_digest": "0b27f6f580eb61f0566acafc3c035bb0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 8641, "upload_time": "2018-07-21T18:28:34", "url": "https://files.pythonhosted.org/packages/91/74/188d1adbce218e1947d391b2bbb0084db83f3c007707f052a6c09adf0db5/django-progressiveimagefield-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "cda3590eb3e04c3266c087c6529f36fc", "sha256": "0c93fc34c2c1f3d2ba79d3a1a3984ba032041d58bd8d96ca12c00068ddfb40f3" }, "downloads": -1, "filename": "django_progressiveimagefield-0.1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "cda3590eb3e04c3266c087c6529f36fc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 11116, "upload_time": "2018-11-07T10:49:53", "url": "https://files.pythonhosted.org/packages/85/25/9d66c9fa647c9085dd317ba14d831c2eb9da9bb8fb7a8c49c3f369b6c867/django_progressiveimagefield-0.1.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "237f3bec8b8421ec208d0285766c3267", "sha256": "29efa65f5fef18486db26086797ba12db7c05fd51d69e880cdc1383e603607cd" }, "downloads": -1, "filename": "django-progressiveimagefield-0.1.4.tar.gz", "has_sig": false, "md5_digest": "237f3bec8b8421ec208d0285766c3267", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 7726, "upload_time": "2018-11-07T10:49:55", "url": "https://files.pythonhosted.org/packages/c4/28/770e7ea23aada34b2cb2bfcdaf2c836fb6c939d127251da084a03dc5c80a/django-progressiveimagefield-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "50f71e387e7047dff113f6cfd2d6c1c3", "sha256": "3f37d4f040f7c13f69ab8e5ff184e01c8e43f8d940e23986ecb86f8be2ed60d7" }, "downloads": -1, "filename": "django_progressiveimagefield-0.1.5-py3-none-any.whl", "has_sig": false, "md5_digest": "50f71e387e7047dff113f6cfd2d6c1c3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 11116, "upload_time": "2019-03-10T15:51:05", "url": "https://files.pythonhosted.org/packages/74/48/43a848a8d7b50e81c9f6abd9cdb7152c6399237636751076b453cae07830/django_progressiveimagefield-0.1.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "74491a5bb3467822481cd83b7a56421f", "sha256": "3ff8926854fd626848f79611ade8cd2e53b8745ce6d77d4fa98250c244e5d2f2" }, "downloads": -1, "filename": "django-progressiveimagefield-0.1.5.tar.gz", "has_sig": false, "md5_digest": "74491a5bb3467822481cd83b7a56421f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 7711, "upload_time": "2019-03-10T15:51:06", "url": "https://files.pythonhosted.org/packages/50/29/c4c92fbfa47af3b6b6569e38f6adc3b4ea9dbcefa87632a0a67c81922f2d/django-progressiveimagefield-0.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "50f71e387e7047dff113f6cfd2d6c1c3", "sha256": "3f37d4f040f7c13f69ab8e5ff184e01c8e43f8d940e23986ecb86f8be2ed60d7" }, "downloads": -1, "filename": "django_progressiveimagefield-0.1.5-py3-none-any.whl", "has_sig": false, "md5_digest": "50f71e387e7047dff113f6cfd2d6c1c3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 11116, "upload_time": "2019-03-10T15:51:05", "url": "https://files.pythonhosted.org/packages/74/48/43a848a8d7b50e81c9f6abd9cdb7152c6399237636751076b453cae07830/django_progressiveimagefield-0.1.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "74491a5bb3467822481cd83b7a56421f", "sha256": "3ff8926854fd626848f79611ade8cd2e53b8745ce6d77d4fa98250c244e5d2f2" }, "downloads": -1, "filename": "django-progressiveimagefield-0.1.5.tar.gz", "has_sig": false, "md5_digest": "74491a5bb3467822481cd83b7a56421f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 7711, "upload_time": "2019-03-10T15:51:06", "url": "https://files.pythonhosted.org/packages/50/29/c4c92fbfa47af3b6b6569e38f6adc3b4ea9dbcefa87632a0a67c81922f2d/django-progressiveimagefield-0.1.5.tar.gz" } ] }