{ "info": { "author": "Juan-Pablo Scaletti", "author_email": "juanpablo@lucumalabs.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "===========================\nRevAssets\n===========================\n\n.. image:: https://travis-ci.org/jpscaletti/rev-assets.svg?branch=master\n :target: https://travis-ci.org/jpscaletti/rev-assets\n :alt: Build Status\n\nYou care about the performance of your site, so you've configured the web server to cache all your assets for a long time. The most used way to bypass that cache when deploying a new version, is to add a hash of the assets to their names.\n::\n\t'scripts/home.js' --> 'scripts/home.1a23b.js'\n\t'styles/home.css' --> 'styles/home.aef45.css'\n\nThe problem is, now your Python web app can't find the file unless you manually \u2013and painstakingly\u2014 update all the URLs in the templates.\n\n.. code:: html+jinja\n\n\t\n\t\n\nWhit this library, there is no need for that. Just change your templates to:\n\n.. code:: html+jinja\n\n\t\n\t\n\nand use this code:\n\n.. code:: python\n\n\t# app.py\n\tfrom flask import Flask, render_template\n\tfrom rev_assets import RevAssets\n\n\tapp = flask.Flask(__name__)\n\n\trev = RevAssets(reload=app.debug)\n\tapp.jinja_env.filters['asset_url'] = rev.asset_url\n\n\t@app.route('/')\n\tdef index():\n\t return render_template('index.html')\n\nand it will work for every version of the assets that you build.\n\nThis works by reading the ``manifest.json`` generated by the revision tool (so don't forget to configure your task runner to make one).\n\nYou can continue to use the old method to link un-versioned assets, like ``favicon.ico`` and others like it.\n\nNote that *this is not a Flask extension*, but a Python library. You can use it with any other framework. You can also have many instances of ``RevAssets`` linked to differents manifests.\n\n\nRun the tests\n======================\n\nWe use some external dependencies, listed in ``requirements_tests.txt``::\n\n $ pip install -r requirements-tests.txt\n $ python setup.py develop\n\nTo run the tests in your current Python version do::\n\n $ make test\n\nTo run them in every supported Python version do::\n\n $ tox\n\nOur test suite `runs continuously on Travis CI `_ with every update.\n\n\nContributing\n======================\n\n#. Check for `open issues `_ or open\n a fresh issue to start a discussion around a feature idea or a bug.\n#. Fork the `RevAssets repository on Github `_\n to start making your changes.\n#. Write a test which shows that the bug was fixed or that the feature works\n as expected.\n#. Send a pull request and bug the maintainer until it gets merged and published.\n :) Make sure to add yourself to ``AUTHORS``.\n\n______\n\n:copyright: `Juan-Pablo Scaletti `_.\n:license: BSD-3-Clause, see LICENSE.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/jpscaletti/rev-assets", "keywords": "", "license": "BSD-3-Clause (see LICENSE)", "maintainer": "", "maintainer_email": "", "name": "rev-assets", "package_url": "https://pypi.org/project/rev-assets/", "platform": "", "project_url": "https://pypi.org/project/rev-assets/", "project_urls": { "Homepage": "http://github.com/jpscaletti/rev-assets" }, "release_url": "https://pypi.org/project/rev-assets/1.0.3/", "requires_dist": null, "requires_python": "", "summary": "Make possible to use hashed static assets generated by tools like Gulp or Webpack", "version": "1.0.3" }, "last_serial": 4694357, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "abe6b1d2918b8e26c8c2b4b49630b953", "sha256": "fda9d38625a542ef48c2142b315500d76d0f2b8d07de02fd2dd1deea8cdc9ae8" }, "downloads": -1, "filename": "rev_assets-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "abe6b1d2918b8e26c8c2b4b49630b953", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 2886, "upload_time": "2017-04-25T02:54:19", "url": "https://files.pythonhosted.org/packages/c0/5d/4a5321e49cb2ab27f457791be6d991b858d0dcfc3258f3e13d8a923f04c5/rev_assets-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "351fa6921c2c17cbc3af5d36fb64fea3", "sha256": "6eb0a57a112a76307875445cd80c1bbcf7cfe262bc2d33f8116068cb1f8d95df" }, "downloads": -1, "filename": "rev-assets-1.0.0.tar.gz", "has_sig": false, "md5_digest": "351fa6921c2c17cbc3af5d36fb64fea3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4735, "upload_time": "2017-04-25T02:54:17", "url": "https://files.pythonhosted.org/packages/cb/95/da6b19183426423b3a8bc5dbb485f252e5ae7145f3d5c4c5eced8dbb7e88/rev-assets-1.0.0.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "01ec4d6aac78441148bf6c05bd8eec96", "sha256": "0213db5023d32ceee66a3e495938a53b5ea6af7d1305b242729bd5698bb2d23e" }, "downloads": -1, "filename": "rev_assets-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "01ec4d6aac78441148bf6c05bd8eec96", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 5764, "upload_time": "2017-04-25T03:44:20", "url": "https://files.pythonhosted.org/packages/cd/76/fdab0a8ce746b69eb11ef1afc6fdafa7dd7efa7334ede6d062fa7df294d9/rev_assets-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c6d488f407a456a6ebac7811e3b1c6c4", "sha256": "89233748b0916a3f25ac2ef4af803fea6f2a474904f50e5455ddc7e5ae0ae6d5" }, "downloads": -1, "filename": "rev-assets-1.0.2.tar.gz", "has_sig": false, "md5_digest": "c6d488f407a456a6ebac7811e3b1c6c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4974, "upload_time": "2017-04-25T03:44:18", "url": "https://files.pythonhosted.org/packages/12/a8/fca6763bbdb3bc9ee487e259282c6ac1a7ce7544f7c5e95321b7aaa75192/rev-assets-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "d2a7e5b10a7c6f064fbe8b40afa779b1", "sha256": "1d5e0f292d740973ca5d335118268ee4d79e97257123bf5d17ecede153d4669c" }, "downloads": -1, "filename": "rev_assets-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "d2a7e5b10a7c6f064fbe8b40afa779b1", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 5796, "upload_time": "2017-04-25T03:59:01", "url": "https://files.pythonhosted.org/packages/cf/ff/2bde4a6a7172b7411c727d9845732013fa54875bf6560daf6656584b4ae1/rev_assets-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a4af13273612041b8e460175cc2be910", "sha256": "57945e3d13968a704bb11d622703a001c5fd762dc4af2cb3cca293f5ffea801f" }, "downloads": -1, "filename": "rev-assets-1.0.3.tar.gz", "has_sig": false, "md5_digest": "a4af13273612041b8e460175cc2be910", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5037, "upload_time": "2017-04-25T03:58:58", "url": "https://files.pythonhosted.org/packages/45/62/4ca6a3300f454865da840f3b01766d60b9dc38117c4d942755aebfd033ab/rev-assets-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d2a7e5b10a7c6f064fbe8b40afa779b1", "sha256": "1d5e0f292d740973ca5d335118268ee4d79e97257123bf5d17ecede153d4669c" }, "downloads": -1, "filename": "rev_assets-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "d2a7e5b10a7c6f064fbe8b40afa779b1", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 5796, "upload_time": "2017-04-25T03:59:01", "url": "https://files.pythonhosted.org/packages/cf/ff/2bde4a6a7172b7411c727d9845732013fa54875bf6560daf6656584b4ae1/rev_assets-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a4af13273612041b8e460175cc2be910", "sha256": "57945e3d13968a704bb11d622703a001c5fd762dc4af2cb3cca293f5ffea801f" }, "downloads": -1, "filename": "rev-assets-1.0.3.tar.gz", "has_sig": false, "md5_digest": "a4af13273612041b8e460175cc2be910", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5037, "upload_time": "2017-04-25T03:58:58", "url": "https://files.pythonhosted.org/packages/45/62/4ca6a3300f454865da840f3b01766d60b9dc38117c4d942755aebfd033ab/rev-assets-1.0.3.tar.gz" } ] }