{ "info": { "author": "Edouard Richard", "author_email": "edou4rd@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.11", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "# django-url-renditions\n\ndjango-url-renditions allows to define and render renditions from django url fields. This works also pretty well with [django-s3direct](https://github.com/bradleyg/django-s3direct) fields.\n\nIt comes with a Graphene `Query` that enable renditions in your GraphQL schema.\n\n## Install\n\n```\npip install django-url-renditions\n```\n\nAdd `url_renditions` to your `INSTALLED_APPS`\n\n\n## Define your model\n\n\n```python\nfrom django.db import models\nfrom url_renditions.fields import FileUrlWithRenditions\n\n# django-url-renditions comes with a simple image resizer method.\n# Look at the implementation if you need something more specific\nfrom url_renditions.resize_image import ResizeImage\n\nclass Track(models.Model):\n original_artwork = models.URLField()\n artwork = FileUrlWithRenditions(\n source='original_artwork',\n use_job_runner=True, # if we want to queue the job with django_rq\n renditions={\n 'small': ResizeImage('80x80'),\n 'medium': ResizeImage('300x300'),\n }\n )\n\n```\n\n\nThat way, when a `Track` model get created with an `original_artwork`, `artwork` will be automatically polulated with two renditions: `small` and `medium`.\n\nTo access them, use:\n```python\nr = my_track.artwork.rendition_set.get(name='small')\nprint('url:', r.href, 'width:', r.width, 'height:', r.height)\n```\n\n\n## Graphql with Graphene\n\nAdd `url_renditions.graphql_schema.Query` to your root query.\n```python\nimport graphene\nimport url_renditions.graphql_schema # noqa\n\nclass Query(\n ...\n url_renditions.graphql_schema.Query,\n graphene.ObjectType):\n pass\n\nschema = graphene.Schema(query=Query)\n```\n\nThen when you ask for\n\n```graphql\n{\n track(id: \"VHJhY2s6OA==\") {\n artwork {\n renditions {\n medium {\n href\n width\n height\n }\n }\n }\n }\n}\n```\n\nYou get\n\n\n```json\n{\n \"data\": {\n \"track\": {\n \"artwork\": {\n \"renditions\": {\n \"medium\": {\n \"href\": \"https://images.unsplash.com/photo-1474314170901-f351b68f544f\",\n \"width\": 300,\n \"height\": 300\n }\n }\n }\n }\n }\n}\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/vied12/django-url-renditions", "keywords": "", "license": "BSD License", "maintainer": "", "maintainer_email": "", "name": "django-url-renditions", "package_url": "https://pypi.org/project/django-url-renditions/", "platform": "", "project_url": "https://pypi.org/project/django-url-renditions/", "project_urls": { "Homepage": "https://github.com/vied12/django-url-renditions" }, "release_url": "https://pypi.org/project/django-url-renditions/1.2/", "requires_dist": null, "requires_python": "", "summary": "Create custom renditions from django url fields", "version": "1.2" }, "last_serial": 4941136, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "8907a92395c2e0e6a079095f95205b08", "sha256": "fe538fb7bfce9b3ea67ef8cee52724fd40153724234eab0b9d7285f3f9b3da25" }, "downloads": -1, "filename": "django-url-renditions-0.1.tar.gz", "has_sig": false, "md5_digest": "8907a92395c2e0e6a079095f95205b08", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4678, "upload_time": "2018-05-15T15:11:27", "url": "https://files.pythonhosted.org/packages/28/89/042c90ebe8fd910023e92c4be4c1ad538db367026cbb1d185b273e3fb3f0/django-url-renditions-0.1.tar.gz" } ], "0.10": [ { "comment_text": "", "digests": { "md5": "12b45d1adb82025ed923885ba15a4591", "sha256": "163f7033992aa50f5fdfe96a2d9889f3ddb43346dadc05cf89669b6dfef76538" }, "downloads": -1, "filename": "django-url-renditions-0.10.tar.gz", "has_sig": false, "md5_digest": "12b45d1adb82025ed923885ba15a4591", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6000, "upload_time": "2019-03-05T09:02:55", "url": "https://files.pythonhosted.org/packages/1d/9b/63f5668e4eb20c2809c2d71b1fc585463ce9680da711f1512ffb057a5313/django-url-renditions-0.10.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "99e3da22535118ece887146b1630e147", "sha256": "da66a6351100eb92a3b3d73acb6ad119160d357aa656c30541dae30d3463ea41" }, "downloads": -1, "filename": "django-url-renditions-0.2.tar.gz", "has_sig": false, "md5_digest": "99e3da22535118ece887146b1630e147", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5842, "upload_time": "2018-05-15T16:01:45", "url": "https://files.pythonhosted.org/packages/77/f0/8d8d75067ad7295f67547e123aaccf7d3208cfaa9891aa47c69e7fa7a6fd/django-url-renditions-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "da7d8c5bca27e25020fcddfce9d27c53", "sha256": "ab3c3b26ba98c71c08453a7e114caa2a478d0cf4504f99d7c093fb786c41b980" }, "downloads": -1, "filename": "django-url-renditions-0.3.tar.gz", "has_sig": false, "md5_digest": "da7d8c5bca27e25020fcddfce9d27c53", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5878, "upload_time": "2018-05-15T16:04:17", "url": "https://files.pythonhosted.org/packages/41/e8/76c9117668e1d048bae5338d07a9729395a5daa65631e0678274670009b4/django-url-renditions-0.3.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "1dc4f48ca49a42b1f78d2ea88cc84664", "sha256": "96bf90c5b331f60b524657de63b8750ad80cd54aa7873c3af6ac76fa2c9ce5c7" }, "downloads": -1, "filename": "django-url-renditions-0.5.tar.gz", "has_sig": false, "md5_digest": "1dc4f48ca49a42b1f78d2ea88cc84664", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5949, "upload_time": "2018-05-24T12:34:37", "url": "https://files.pythonhosted.org/packages/4d/31/3deb4e22613d0cfaafc3e2d404b1e95b8e60d92e25946ef7b24bf3a6d687/django-url-renditions-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "03b59055711700308a5d3f71a34f5fc5", "sha256": "64d66c324cc9a5ed58ffdfacd46bdddf7d9687dd5b241da786cfa03a5261864d" }, "downloads": -1, "filename": "django-url-renditions-0.6.tar.gz", "has_sig": false, "md5_digest": "03b59055711700308a5d3f71a34f5fc5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5939, "upload_time": "2018-05-24T12:38:19", "url": "https://files.pythonhosted.org/packages/cd/a4/0bead47869155d206225cc0f6011d4899f6cfef2ca5e377a8452982e083b/django-url-renditions-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "b9abf34502c0fba23d2cee25afa2cdb8", "sha256": "f14a090933c3cb36f7212b4d494893a2f6500ff5f55bda9691a93bef1aa03654" }, "downloads": -1, "filename": "django-url-renditions-0.7.tar.gz", "has_sig": false, "md5_digest": "b9abf34502c0fba23d2cee25afa2cdb8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5973, "upload_time": "2018-05-31T15:39:30", "url": "https://files.pythonhosted.org/packages/7e/23/82a2ff826c3fd109c07ffed62b3654eebe8ee869b4300bd813e99255ab33/django-url-renditions-0.7.tar.gz" } ], "0.8": [ { "comment_text": "", "digests": { "md5": "678a1fb49e21d54e7cb40fa289a901d6", "sha256": "a822afde7fe100dcd98d26c08fd1be12b8e172da80ea4f037c2f0871be999bad" }, "downloads": -1, "filename": "django-url-renditions-0.8.tar.gz", "has_sig": false, "md5_digest": "678a1fb49e21d54e7cb40fa289a901d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5938, "upload_time": "2018-06-06T12:51:23", "url": "https://files.pythonhosted.org/packages/99/de/20cfce2677ed115ae729b122127d4f594fafa362a271bc9a265d005c1388/django-url-renditions-0.8.tar.gz" } ], "0.9": [ { "comment_text": "", "digests": { "md5": "46b43756bcbbb728f3503278c0a56a85", "sha256": "72f4e024946ac11d8c12664e03d738aa3bc5af4a4a85259ca0361000587b200a" }, "downloads": -1, "filename": "django-url-renditions-0.9.tar.gz", "has_sig": false, "md5_digest": "46b43756bcbbb728f3503278c0a56a85", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5958, "upload_time": "2018-11-06T13:08:53", "url": "https://files.pythonhosted.org/packages/06/56/e27bc7728c957afad17574ae6bdc2a2106af433b024a94984e10e6c1150e/django-url-renditions-0.9.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "cb55f04666cabad7990b0069ca6b8ee8", "sha256": "c795096213e83dd69d721d885f7723146db6d741f231fbfa901d2cd4052688c0" }, "downloads": -1, "filename": "django-url-renditions-1.1.tar.gz", "has_sig": false, "md5_digest": "cb55f04666cabad7990b0069ca6b8ee8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6039, "upload_time": "2019-03-07T13:32:54", "url": "https://files.pythonhosted.org/packages/98/4c/3bd6c97df340d43c8e062337debd984c4fba2d1075322adee515d256a3f3/django-url-renditions-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "55d193784dc9411d6114db01cbafc814", "sha256": "42239b5b835ec080a6286610f5aadbb5fae126205b355871a0b33f5e339cda4f" }, "downloads": -1, "filename": "django-url-renditions-1.2.tar.gz", "has_sig": false, "md5_digest": "55d193784dc9411d6114db01cbafc814", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6107, "upload_time": "2019-03-14T18:36:53", "url": "https://files.pythonhosted.org/packages/15/b7/925d2452e68491539a07023ccfd17b0e5a51235e2ef1fea0f23c52685e4c/django-url-renditions-1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "55d193784dc9411d6114db01cbafc814", "sha256": "42239b5b835ec080a6286610f5aadbb5fae126205b355871a0b33f5e339cda4f" }, "downloads": -1, "filename": "django-url-renditions-1.2.tar.gz", "has_sig": false, "md5_digest": "55d193784dc9411d6114db01cbafc814", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6107, "upload_time": "2019-03-14T18:36:53", "url": "https://files.pythonhosted.org/packages/15/b7/925d2452e68491539a07023ccfd17b0e5a51235e2ef1fea0f23c52685e4c/django-url-renditions-1.2.tar.gz" } ] }