{
"info": {
"author": "Bolster Labs, Inc",
"author_email": "opensource@boslterlabs.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Multimedia :: Graphics"
],
"description": "========\nsorl-url\n========\n\nOut-of-band processing for sorl-thumbnail thumbnails.\n\nInstallation & Setup\n====================\n\nInstallation\n------------\n\nInstallation is as easy as ``pip install sorl-url`` though the latest version is always available on `GitHub `_.\n\nSetup\n-----\n\n1. Add ``sorl-url`` to your ``settings.INSTALLED_APPS``.\n2. Add ``url(r'^thumbnails/', include('sorl_url.urls'))`` to your URL configuration.\n3. Configure your defaults (see Usage_ below).\n\nRequirements\n============\n\nBase Requirements\n-----------------\n\n* sorl-thumbnail 11.12+\n\nsorl-thumbnail\n--------------\n\nMikko Hellsing's excellent `sorl-thumbnail `_ is the only direct requirement for this project.\n\nYou can read more about sorl-thumbnail, its `requirements `_ and how it is `installed and configured `_ at `Read the Docs `_.\n\n.. _usage:\n\nUsage\n=====\n\nThe core workflow is built around usage through a template tag named ``image_url`` in the ``sorl_url`` template tag library.\n\n``sorl_url`` does not serve images directly. It generates them as sorl-thumbnail would (storing them in a cache via ``settings.THUMBNAIL_STORAGE``) and then redirects to the URL of the generated image.\n\nTemplate Tags\n-------------\n\nThe primary invocation of ``sorl_url`` is through the ``image_url`` template tag, which uses the following basic syntax::\n\n {% image_url SOURCE FIELD_NAME GEOMETRY [key1=VAL1 key2=VAL2...] %}\n\nor::\n\n {% image_url SOURCE FIELD_NAME GEOMETRY [key1=VAL1 key2=VAL2...] as VAR %}\n The image URL is {{ VAR }}.\n {% empty %}\n This block is optional.\n {% endimage_url}\n\nAn example invocation might be::\n\n <% load image_url %>\n\n
\n\nWhich might render as *(linebreaks added)*::\n\n
\n\nFor a complete list of available options, please consult the documentation for sorl-thumbnail's `thumbnail template tag `_.\n\nURL Structure\n-------------\n\nsorl-url generates URLs of the form: ``/prefix/MODEL_NAME/FIELD_NAME/KEY.ext?config=OPTIONS``\n\n``prefix`` is dictated by the location at which the ``sorl-url`` views are included in the URLConf\n\n``OPTIONS`` is a configuration including the size and other options signed and obfuscated by the ``django.core.signing`` module described in `URL Arguments`_ below.\n\n**Note:** the ``config`` query string argument is mandatory. Failure to provide a ``config`` will result in a 404.\n\n\n.. _URL arguments:\n\nURL Arguments\n~~~~~~~~~~~~~\n\nImage options are passed via the ``config`` query string argument. The values are obfuscated but **not** enscrypted. They are serialized, compressed and signed by ``django.core.signing``.\n\nDefault options specified in ``SORL_URL_CONFIG`` and other sorl settings are **not** included in the query string. However, the signature is salted with a variety of attributes, including the underlying filename and a hash of all relevant settings to ensure that as underlying attributes and settings are updated, the URL will change as well. Note that this means that a change to ``SORL_URL_CONFIG``, for example, will result in all URLs being updated. This may or may not result in new images being generated by sorl (depending on what has been changed).\n\n**Debugging**: To easily see what arguments are being passed for rendering, simply set ``settings.THUMBNAIL_DEBUG`` to ``True`` and append ``&echo=True`` to any generated URL to see what options are being passed.\n\nConfiguring Settings\n--------------------\n\nThe available options and defaults are controlled by the ``SORL_URL_CONFIG`` setting.\n\n``SORL_URL_CONFIG`` must be a dictionary-like object with keys corresponding to the ``MODEL_NAME`` URL component and a dictionary-like value representing the *model configuration*.\n\nAdditionally ``SORL_URL_PERMANENT_REDIRECT`` (default: ``False``) can be used to control the type of redirect that is used.\n\nModel Configuration\n~~~~~~~~~~~~~~~~~~~\n\nEach model configuration offers the following options:\n\n* ``model``: either a model class or the Django-style dotted name (``app_label.ModelName``) **(required)**\n* ``fields``: a list of the attributes on model that should be exposed by this configuration; alternatively a 2-tuple of the format ``(attr_name, options)`` where ``options`` is a dictionary containing default to be passed to the sorl backend's ``get_thumbnail`` method **(required)**\n* ``backend``: the sorl backend, as a string representing the module path, to be used *(optional; defaults to ``sorl.thumbnail.default.backend``)*\n* ``key_field``: the field to be used in object lookups for the key portion of the URL *(optional; defaults to ``id``)*\n* ``key_filter``: a transformation function to be applied to the key URL component to ensure it is properly prepared for the ORM *(optional; defaults to ``lambda x: int(x)``)*\n* ``options``: a dictionary containing default options to be passed to the sorl backend's ``get_thumbnail`` method. Individual fields may override these options. *(optional; defaults to ``{}``)*\n\nConfiguration Examples\n~~~~~~~~~~~~~~~~~~~~~~\n\nA minimal configuration might look like::\n\n SORL_URL_CONFIG = {\n 'profiles': {\n 'model': 'profiles.Profile',\n 'fields': ['avatar'],\n }\n }\n\nThe above configuration would mean that the following URL would be valid: ``/prefix/profiles/avatar/1.png?config=CONFIG``\n\nA more advanced configuration might look like::\n\n SORL_URL_CONFIG = {\n 'profiles': {\n 'model': 'profiles.Profile',\n 'fields': [\n ('avatar', {\n 'format': 'PNG',\n 'crop': 'top',\n 'upscale': True\n }),\n ('background': {\n 'format': 'JPEG',\n 'quality': 90,\n 'colorspace': 'GRAY'\n }\n )\n ],\n 'key_field': 'user__username',\n 'key_filter': None # The default is lambda x: int(x),\n # but None implies a no-op (lambda x: x)\n }\n }\n\nThe above configuration would mean that the following URLs would be exposed:\n \n* ``/prefix/profiles/avatar/1.png?config=CONFIG``\n* ``/prefix/profiles/background/1.jpg?config=CONFIG``\n",
"description_content_type": null,
"docs_url": null,
"download_url": "UNKNOWN",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/bolster/sorl-url",
"keywords": null,
"license": "BSD",
"maintainer": null,
"maintainer_email": null,
"name": "sorl-url",
"package_url": "https://pypi.org/project/sorl-url/",
"platform": "any",
"project_url": "https://pypi.org/project/sorl-url/",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "https://github.com/bolster/sorl-url"
},
"release_url": "https://pypi.org/project/sorl-url/0.2.1/",
"requires_dist": null,
"requires_python": null,
"summary": "Out-of-band processing for sorl-thumbnail thumbnails.",
"version": "0.2.1"
},
"last_serial": 799834,
"releases": {
"0.1": [
{
"comment_text": "",
"digests": {
"md5": "ccca61e8854add95199de82b99020798",
"sha256": "01aa4004c1d9a55fca2edd98c20116c006980599ffadee2d51ff091517d09400"
},
"downloads": -1,
"filename": "sorl-url-0.1.tar.gz",
"has_sig": false,
"md5_digest": "ccca61e8854add95199de82b99020798",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5497,
"upload_time": "2012-06-24T17:56:42",
"url": "https://files.pythonhosted.org/packages/a5/38/38f148607a31e6c9fec122714e2a90083c97011a36a9128234ee1ba26898/sorl-url-0.1.tar.gz"
}
],
"0.1.1": [
{
"comment_text": "",
"digests": {
"md5": "65c2f3f71813edcd65c2c4fd47180d88",
"sha256": "0201b0f3e1a143d0eda0d7fc727929d1c471a044ac8f1bc19bfd141adc24da2a"
},
"downloads": -1,
"filename": "sorl-url-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "65c2f3f71813edcd65c2c4fd47180d88",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5805,
"upload_time": "2012-06-24T19:21:38",
"url": "https://files.pythonhosted.org/packages/29/e6/a24fb39585d13d9dcd212048953e9767e039f8f9ccd02cd40444594060ee/sorl-url-0.1.1.tar.gz"
}
],
"0.1.2": [
{
"comment_text": "",
"digests": {
"md5": "aad6c2976148478b1d75c9bd040b87a2",
"sha256": "036998ee221600bcf7cd7136e83eb592fec3ac601efdcf6207efeeb6f95464b5"
},
"downloads": -1,
"filename": "sorl-url-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "aad6c2976148478b1d75c9bd040b87a2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 6212,
"upload_time": "2012-07-10T20:38:50",
"url": "https://files.pythonhosted.org/packages/39/e2/fd6c188b6b7da7cecd92617c230a604802a510a69fbdfd7d4b043d4303fc/sorl-url-0.1.2.tar.gz"
}
],
"0.1.3": [
{
"comment_text": "",
"digests": {
"md5": "b8f4685683c84f15ebaa24e3067b18fb",
"sha256": "f64f5ea633910290423373b618f438c95ebee27d4ed37e8732fb7ce7eb4d20b7"
},
"downloads": -1,
"filename": "sorl-url-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "b8f4685683c84f15ebaa24e3067b18fb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8929,
"upload_time": "2012-12-17T19:19:15",
"url": "https://files.pythonhosted.org/packages/a4/34/61837f0e78ec544ce9602be48f427e9a172e9486566ac6ea3c0f7194b231/sorl-url-0.1.3.tar.gz"
}
],
"0.1.4": [
{
"comment_text": "",
"digests": {
"md5": "e5e0d53fac7ff034b505432b42a70f87",
"sha256": "de1e6b5bcd485b4c3c1f2de92e05ea6c3b2ec268eef99c75e0e9e851151ee489"
},
"downloads": -1,
"filename": "sorl-url-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "e5e0d53fac7ff034b505432b42a70f87",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8904,
"upload_time": "2012-12-18T19:53:02",
"url": "https://files.pythonhosted.org/packages/a6/1f/6ca24ffc82533d8ecb8e11aea41ba0e8cf5563bbb46e04532ef3c2a8792d/sorl-url-0.1.4.tar.gz"
}
],
"0.1.5": [
{
"comment_text": "",
"digests": {
"md5": "2e607c4620caccbf148645b40c89edc4",
"sha256": "422f68ab93acf4b64ddd4ac087d1bc0479b3955e92bdde6cf68c3529cc5a3f2b"
},
"downloads": -1,
"filename": "sorl-url-0.1.5.tar.gz",
"has_sig": false,
"md5_digest": "2e607c4620caccbf148645b40c89edc4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8946,
"upload_time": "2013-01-02T03:13:50",
"url": "https://files.pythonhosted.org/packages/a0/29/404831ccd3ae6877b5b49154f3b6046038c44e4c307e1ae666d8bfa9f824/sorl-url-0.1.5.tar.gz"
}
],
"0.1.6": [
{
"comment_text": "",
"digests": {
"md5": "12e3e160b437a1919a0cfb680b9338f0",
"sha256": "9b873eb42aca8ce75f82da2816e884a0ab526bd2175a5922184cdfa081dad4f9"
},
"downloads": -1,
"filename": "sorl-url-0.1.6.tar.gz",
"has_sig": false,
"md5_digest": "12e3e160b437a1919a0cfb680b9338f0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 9478,
"upload_time": "2013-01-03T15:58:42",
"url": "https://files.pythonhosted.org/packages/fe/3a/cd0dd543285c77a98b3591d47666da818b2263c0b1aaf927b3d94f145cbd/sorl-url-0.1.6.tar.gz"
}
],
"0.1.8": [
{
"comment_text": "",
"digests": {
"md5": "099a4c49690786b91aceef01d8743697",
"sha256": "c1f57a4402864f84d9417eac7cec24d99cdc58767471644a0d1709374dec28cb"
},
"downloads": -1,
"filename": "sorl-url-0.1.8.tar.gz",
"has_sig": false,
"md5_digest": "099a4c49690786b91aceef01d8743697",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 9523,
"upload_time": "2013-01-03T16:44:45",
"url": "https://files.pythonhosted.org/packages/ac/3a/1fa5a7fda61395011d2027d058868588d6a4bbe29b69e134128b7b0d491b/sorl-url-0.1.8.tar.gz"
}
],
"0.2.1": [
{
"comment_text": "",
"digests": {
"md5": "cd661adfc436d70883bd4f21a39a45fe",
"sha256": "d4f7741f75447d62aee97480c0f976c6bd4d7402b4284ecc86a4c7350cf0c3d8"
},
"downloads": -1,
"filename": "sorl-url-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "cd661adfc436d70883bd4f21a39a45fe",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10044,
"upload_time": "2013-01-04T14:36:34",
"url": "https://files.pythonhosted.org/packages/3f/6d/34430fb2bbc831bfd3f72aa62ac9ec90eac1921291320fe493162712106e/sorl-url-0.2.1.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "cd661adfc436d70883bd4f21a39a45fe",
"sha256": "d4f7741f75447d62aee97480c0f976c6bd4d7402b4284ecc86a4c7350cf0c3d8"
},
"downloads": -1,
"filename": "sorl-url-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "cd661adfc436d70883bd4f21a39a45fe",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10044,
"upload_time": "2013-01-04T14:36:34",
"url": "https://files.pythonhosted.org/packages/3f/6d/34430fb2bbc831bfd3f72aa62ac9ec90eac1921291320fe493162712106e/sorl-url-0.2.1.tar.gz"
}
]
}