{ "info": { "author": "Ted Tieken , Peter Conerly ", "author_email": "ted.tieken@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "NB: This package is experimental pre-alpha software. The convoy features\nare more mature than the carpool features.\n\nRationale:\n----------\n\n``django-asset-convoy`` makes static asset best practices nearly\neffortless without changing your current workflow. Your files are\nprocessed for you when you run collectstatic, and the template tags to\naccess your processed files are easy to use.\n\nStatic asset best practices = Faster page loads = happier customers.\n\n- fingerprint based cachebusting which enables far-future cache exipry\n headers (cached files load instantly)\n- minification (smaller files load faster)\n- gzipping that works on S3 (compressed files load faster)\n- concatenation (fewer http requests means less latency and faster page\n loads)\n\nEverything but concatenation is done automatically during the\npost\\_process step of django's ``python manage.py collectstatic``\ncommand. This means that when Heroku runs collectstatic automatically\nfor you, your assets get post-processed automatically too!\n\nThe ``convoy`` template tag is called exactly the same way the\nstaticfiles ``static`` template tag is called.\n\nThe ``carpool`` template tag that does concatenation is extremely simple\n(see below).\n\nYou get automatic static asset management best practices for about five\nminutes of one-time configuration.\n\nNB: convoy's post processing makes the collectstatic command take about\ntwice as long to run. If you have a lot of unchanged static assets, this\ncan make pushing small changes to Heroku somewhat painful --\n``heroku config:set DISABLE_COLLECTSTATIC=1`` may come in handy if that\nis the case.\n\nSpeed:\n------\n\nWith convoy, your pages load faster. Sometimes a lot faster.\n\nIn initial tests with heroku and s3, using ``convoy`` and ``carpool``\nsped up DocumentReady times from ~1500 milliseconds average to 546\nmilliseconds average. (Google's homepage by hit DocumentReady in 341ms\naverage). Method: Middle 8 of 10 page loads measured without caching by\nchrome devtools. GTmetrix performance reports went from 91%/78% to\n99%/98%.\n\nMore tests pending.\n\nWhat:\n-----\n\ndjango-asset-convoy has a few parts:\n\n- static asset storages that automatically process your static assets\n when you run collectstatic (fingerprinting/cache-busting with a hash,\n minifing, and gziping)\n- caching s3 storages that keep a copy on the local filesystem as well\n as saving on s3 (meaning in-request concatenation goes a lot faster)\n- ``convoy`` template tag that resolves a resource to its processed\n counterpartd\n- ``carpool`` template tag that concatenates css and js files so they\n can be served by a single http request.\n- A GzipHttpOnlyMiddleware that sidesteps the BREACH security\n vulnerability on secure HTTPS pages while allowing gzip performance\n improvements on HTTP pages\n\nRequirements:\n-------------\n\n::\n\n #django >= 1.7\n pip install https://www.djangoproject.com/download/1.7b3/tarball/\n pip install django-s3-folder-storage\n\n pip install cssmin\n pip install rjsmin #recommended\n #or pip install jsmin\n\nOptional, but speeds up your pages even more: ``django-htmlmin``\n\nConfiguration:\n--------------\n\n::\n\n #settings.py\n INSTALLED_APPS = (\n ...\n 'convoy',\n ...\n )\n\nOption 1: Using the filesystem:\n'''''''''''''''''''''''''''''''\n\n::\n\n #settings.py\n STATICFILES_STORAGE = 'convoy.stores.ConvoyStorage' \n\n #Set STATIC_ROOT, STATIC_URL, etc, as normal \n\nOption 2: Using s3-folder-storage\n'''''''''''''''''''''''''''''''''\n\n::\n\n #settings.py\n\n #one of these\n STATICFILES_STORAGE = 'convoy.stores.S3FolderConvoyStorage'\n STATICFILES_STORAGE = 'convoy.stores.CachedS3FolderConvoyStorage'\n\n #Set the following to their appropriate variables\n AWS_STORAGE_BUCKET_NAME = 'my-bucket'\n AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']\n AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY']\n DEFAULT_FILE_STORAGE = 's3_folder_storage.s3.DefaultStorage'\n DEFAULT_S3_PATH = \"media\"\n STATIC_S3_PATH = \"static\"\n MEDIA_ROOT = '/%s/' % DEFAULT_S3_PATH\n STATIC_ROOT = \"/%s/\" % STATIC_S3_PATH\n MEDIA_URL = 'http://%s.s3.amazonaws.com/media/' % AWS_STORAGE_BUCKET_NAME\n STATIC_URL = 'http://%s.s3.amazonaws.com/static/' % AWS_STORAGE_BUCKET_NAME\n ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'\n\nBackends are provided for s3 without s3-folder-storage, not recomended.\n\nSuggested configuration:\n''''''''''''''''''''''''\n\n::\n\n #settings.py\n CONVOY_AWS_HEADERS = {\n #Cache processed assets for a full year \n 'Cache-Control': 'max-age=%s' % (60 * 60 * 24 * 365),\n }\n\nConfiguring the HTTP Only Gzip Middleware:\n''''''''''''''''''''''''''''''''''''''''''\n\n::\n\n #settings.py\n MIDDLEWARE_CLASSES = (\n 'convoy.middleware.GzipHttpOnlyMiddleware',\n ...\n )\n\nUsage: automatic asset pipeline during collectstatic:\n-----------------------------------------------------\n\nWhen you run ``python manage.py collectstatic`` convoy will\nautomatically fingerprint (hash), minify the static files that can be\nminified, and gzip the css and js.\n\nThen in your template ``{% load convoytags %}`` will get you two new\ntags ``convoy`` and ``carpool`` whose usage is as follows:\n\nUsing the ``convoy`` template tag\n---------------------------------\n\nThe ``convoy`` template tag works just like the ``static`` template tag\nprovided by ``django.contrib.staticfiles``\n\n::\n\n Usage::\n\n {% convoy path [as varname] %}\n\n Examples::\n\n {% convoy \"myapp/css/base.css\" %}\n {% convoy variable_with_path %}\n {% convoy \"myapp/css/base.css\" as admin_base_css %}\n {% convoy variable_with_path as varname %} \n\nA sample use in a template would be:\n\n::\n\n mypage.html\n {% load convoytags %}\n \n\nWould render:\n\n::\n\n \n \n\n \n \n\nUsing the ``carpool`` template tag\n----------------------------------\n\nThe ``carpool`` template tag is a concatenator, it works similarly to\nthe ``compress`` tag in django-compressor.\n\n::\n\n Usage::\n\n {% carpool [js,css] %}\n 'file/path/to/concatenate.[js,css]'\n 'file/path/to/join.[js,css]'\n {% endcarpool %}\n\n Examples::\n\n {% carpool css %}\n \"myapp/css/base.css\"\n \"myapp/css/second.css\"\n \"myapp/css/third.css\"\n {% endcarpool %}\n \n If concatenation and pipelining is successful:\n \n \n \n \n If not, falls back to:\n \n \n \n \n \n \n {% carpool js %}\n \"myapp/css/base.js\"\n \"myapp/css/second.js\"\n \"myapp/css/third.js\"\n {% endcarpool %}\n\n Would render something like:\n \n \\n'``\nThe unicode string to use when rendering a Javascript asset path into an\nHTML tag.\n\n``CARPOOL_START_COMMENT_TEMPLATE = u\"\\n\\n\"`` The HTML comment\nplaced before carpool CSS or JS tags are rendered. Can be set to a falsy\nvalue, if you don't want the comment to be added.\n\n``CARPOOL_END_COMMENT_TEMPLATE = CARPOOL_START_COMMENT_TEMPLATE`` The\nHTML comment placed after carpool CSS or JS tags are rendered. Can be\nset to a falsy value, if you don't want the comment to be added.\n\nSettings for when DEBUG=True\n''''''''''''''''''''''''''''\n\n``CONVOY_DURING_DEBUG = False`` When True and DEBUG=True, ``convoy``\ntemplate tag returns processed file urls for each asset path (e.g.\n'myfile.css' becomes 'myfile.fb12a26e32dc.cmin.css'). When\nCONVOY\\_DURING\\_DEBUG = False and DEBUG = True, ``convoy`` template tag\nreturns the url to the original, unprocessed, file (e.g. 'myfile.css'\nstays 'myfile.css')\n\nNB: Using CONVOY\\_DURING\\_DEBUG requires additional setup. You must\n\n- run collectstatic locally ``$ python manage.py collectstatic``\n- configure an explicit static serving url in your urls.py\n ``url(r'^static/(?P.*)$', 'django.views.static.serve',{'document_root': settings.STATIC_ROOT})``\n- run runserver with the ``--nostatic`` option\n ``$ python manage.py runserver --nostatic``\n\n``CARPOOL_COMBINE_DURING_DEBUG = False`` When True and DEBUG = True,\n``carpool`` template tag will concatenates files. To use this setting,\nyou must set CONVOY\\_DURING\\_DEBUG to True. When\nCARPOOL\\_COMBINE\\_DURING\\_DEBUG = False and DEBUG = True, ``carpool``\ntemplate tag renders each asset path into individual\n```` or\n```` tags without\nconcatenating them.\n\nSettings unlikely going to need:\n''''''''''''''''''''''''''''''''\n\n``CONVOY_CONSERVATIVE_MSIE_GZIP = False`` If set to True, will never\nattempt to serve gziped files to MSIE identified browsers. You are\nunlikely to need this unless you're writing your own subclasses that\ngzip more than just js and css files\n\n``CONVOY_AWS_QUERYSTRING_AUTH = False`` Convoy is known to break if you\nset this to True -- don't. We have a special file here so you can still\nuse querystring auth in your media files if you want to.\n\nDevelopment setup\n~~~~~~~~~~~~~~~~~\n\nRequires pandoc https://github.com/jgm/pandoc/releases for registering\non pypi.\n\nIf you want to include convoy locally, use\n``pip install -e /path/to/convoy/``", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-asset-convoy", "package_url": "https://pypi.org/project/django-asset-convoy/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-asset-convoy/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/django-asset-convoy/0.1.3/", "requires_dist": null, "requires_python": null, "summary": "Asset packager for Django applications", "version": "0.1.3" }, "last_serial": 1145515, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "d68cd2fafdeba27adeb38a40189e4668", "sha256": "fe6f457b1120c09e7e13552f243379e315de063064bace106597b420756a8a7b" }, "downloads": -1, "filename": "django-asset-convoy-0.1.0.tar.gz", "has_sig": false, "md5_digest": "d68cd2fafdeba27adeb38a40189e4668", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14709, "upload_time": "2014-07-02T23:08:53", "url": "https://files.pythonhosted.org/packages/12/7f/38606bac6be9492f99694daeacecaab5f439efbb5c48c1c161e1bc1967f0/django-asset-convoy-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "bb172c170952f20be30fd86b0b74c9e9", "sha256": "412eebd48b138bbad52316dab1795b402e8776ffe0df898f332c09cab3b6effa" }, "downloads": -1, "filename": "django-asset-convoy-0.1.1.tar.gz", "has_sig": false, "md5_digest": "bb172c170952f20be30fd86b0b74c9e9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14697, "upload_time": "2014-07-02T23:25:24", "url": "https://files.pythonhosted.org/packages/4a/4b/84248e6e164bc6ff9b4c38008ce81f1f09af380c15dff9fffe36227d4a4e/django-asset-convoy-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "6067f5a713338ed448661ab704d78698", "sha256": "79b4bdb99cd1a1764f97ba5ae4d58d41c651dc23ebf8752811c23cb9165a4323" }, "downloads": -1, "filename": "django-asset-convoy-0.1.2.tar.gz", "has_sig": false, "md5_digest": "6067f5a713338ed448661ab704d78698", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16633, "upload_time": "2014-07-02T23:32:15", "url": "https://files.pythonhosted.org/packages/4f/75/b76470835795e23fd2b434dc441908506c474c92249a2417db2d5b48d9e0/django-asset-convoy-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "75daad0c06302f0a333fe12efeda2171", "sha256": "037adf48bc9b32d5a1407968aa784a42c6fdb21be99d933cc8306b29e9fbb384" }, "downloads": -1, "filename": "django-asset-convoy-0.1.3.tar.gz", "has_sig": false, "md5_digest": "75daad0c06302f0a333fe12efeda2171", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16772, "upload_time": "2014-07-02T23:54:42", "url": "https://files.pythonhosted.org/packages/49/59/ef529cbb14f898b5edc127c11baf636f3cb462f31007da6b23c822ec3d8a/django-asset-convoy-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "75daad0c06302f0a333fe12efeda2171", "sha256": "037adf48bc9b32d5a1407968aa784a42c6fdb21be99d933cc8306b29e9fbb384" }, "downloads": -1, "filename": "django-asset-convoy-0.1.3.tar.gz", "has_sig": false, "md5_digest": "75daad0c06302f0a333fe12efeda2171", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16772, "upload_time": "2014-07-02T23:54:42", "url": "https://files.pythonhosted.org/packages/49/59/ef529cbb14f898b5edc127c11baf636f3cb462f31007da6b23c822ec3d8a/django-asset-convoy-0.1.3.tar.gz" } ] }