{ "info": { "author": "Vanguardistas LLC", "author_email": "brian@vanguardistas.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Pyramid", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Topic :: Internet :: WWW/HTTP" ], "description": "Tools for managing Pyramid static files on a CDN\n================================================\n\nServing static files from a CDN\n-------------------------------\n\nA Content Delivery Network (CDN) allows you to serve static files to\nusers faster. For a web application the primary benefit is that your\npages render faster, giving a better user experience.\n\nAdditionally, content such as JavaScript or CSS files should be\n\"slimmed\" before being placed on a CDN. By decreasing the file size you\nfurther improve the user experience with even faster loading.\n\nvan.static gives you a tool to optionally deploy files to a CDN without\nmaking the development process more onerous.\n\nWorkflow\n++++++++\n\nThis tool aids in implementing a very specific workflow using static files and\npyramid:\n\n * During development static files are stored in subversion and are configured\n as normal in Pyramid applications.\n * Before deployment, the static files are extracted from the eggs by the\n system administrator and uploaded to a CDN. The URL on the CDN varies\n depending on the egg version the files where extracted from.\n * During extraction, CSS and JS files can be optionally minified.\n * In production, the system administrator configures the application to use\n static files from the CDN.\n\nThis workflow has these advantages:\n\n * Minimal impact on development. Changes to files are immediately visible,\n also developers work with un-compressed files.\n * CDN served files can have very long cache-control times while still allowing\n them to be updated almost immediately on application upgrade.\n\nTesting an extraction\n+++++++++++++++++++++\n\nYou can try out the extract tool by running the ``cdn.py`` file directly. The\nfollowing commands will extract the ``static`` resource from the ``deform``\npackage to the ``test_extract`` directory:\n\n $ mkdir test_extract\n $ python van/static/cdn.py --target \"file://$(pwd)/test_extract\" --resource deform:static\n\nNOTE: the deform package must be on the python path.\n\nIf you use a url like this ``s3://mybucket/path/to/files/`` the extracted\nresources will be placed directly in Amazon S3. You need to manually install\n``boto`` to be able to use this functionality.\n\nImplementing in your application\n++++++++++++++++++++++++++++++++\n\nOne way would be to have code like this in your package:\n\n >>> def my_extract_filesystem_command():\n ... \"\"\"Customized extract command for my application\"\"\"\n ... cdn.extract_cmd(['myapp:static', 'deform:static'], yui_compressor=True)\n\n >>> from pyramid.config import Configurator\n >>> def make_pyramid_app(cdn_url=None):\n ... config = Configurator()\n ... config.include('van.static.cdn')\n ... config.add_cdn_view(cdn_url or 'myapp_static', 'myapp:static')\n ... config.add_cdn_view(cdn_url or 'deform_static', 'deform:static')\n ... return config.make_wsgi_app()\n\nYou would make ``my_extract_filesystem_command`` a command line script\nfor the system administrator to run on deployment. Likewise the\n``cdn_url`` configuration option is set by the system administrator to\nthe url where the files were exported to.\n\nGZip Content-Encoding compression\n+++++++++++++++++++++++++++++++++\n\nCompressing resources during extraction is supported for the S3 target.\nS3 and Cloudfront does not directly support on the fly compression at\nthis time so a workaround is used where multiple copies of resources are\nuploaded. One without any encoding and the others with encodings.\n\nThe links to resources should then be generated to compressed or\nnon-compressed resources depending on the capabilities of the browser.\n\nAn example of how to modify the resource generation in a pyramid\napplication is::\n\n >>> from pyramid.request import Request\n >>> class ZippingPyramidRequest(Request):\n ...\n ... def static_url(self, path, **kw):\n ... if 'gzip' in self.accept_encoding:\n ... package, path = path.split(':', 1)\n ... path = '{package}:gzip/{path}'.format(\n ... package=package,\n ... path=path)\n ... return Request.static_url(self, path, **kw)\n\nThe extractor is configured to upload resources with the gzip encoding\nwith the --encoding parameter.\n\nWARNING: The `Vary` HTTP will need to contain `Accept-Encoding` to play\nwell with any caches.\n\nAPT integration\n+++++++++++++++\n\nFor system administrators who use APT to install packages, a useful trick is\nput a snippet into ``/etc/apt/apt.conf.d/``::\n\n DPkg::Post-Invoke:: \"/path/to/extraction/script\";\n\nSo that the extraction script runs whenever packages are installed on the\napplication servers. Note that if you have ``etckeeper`` installed, this should\nbe placed afterwards.\n\nJSLint testing support\n----------------------\n\nNOTE: To use this functionality you must have a ``jslint`` command on your PATH.\n\nThis allows you to run ``jslint`` on all the files in a directory from a\nunittest. For example:\n\n >>> import unittest\n\n >>> class TestJSLint(unittest.TestCase):\n ...\n ... def test_static(self):\n ... from van.static.testing import assert_jslint_dir\n ... from pkg_resources import resource_filename, cleanup_resources\n ... assert_jslint_dir(resource_filename('vanguardistas.publicview', 'static/js'))\n ... cleanup_resources()\n\nYUI3 loader configuration helper\n--------------------------------\n\n``van.static.yui`` holds utilities to simplify setting up a YUI3 loader\nconfiguration from a directory of JS modules.\n\nContributing\n------------\n\nIf you're interested, the primary development repository over at github\nhttps://github.com/jinty/van.static\n\n\n..\n Test... Make sure we can actually create the app:\n\n >>> app = make_pyramid_app()\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/van.static", "keywords": "", "license": "BSD-derived", "maintainer": "", "maintainer_email": "", "name": "van.static", "package_url": "https://pypi.org/project/van.static/", "platform": "", "project_url": "https://pypi.org/project/van.static/", "project_urls": { "Homepage": "http://pypi.python.org/pypi/van.static" }, "release_url": "https://pypi.org/project/van.static/1.9/", "requires_dist": null, "requires_python": "", "summary": "Tools for managing Pyramid static files on a CDN", "version": "1.9" }, "last_serial": 3869373, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "94b76277085b038c007f7cca76725d73", "sha256": "934478a9c8e4bce398c1a2b33484f210255c478dffe77b6aa07321c4d160af19" }, "downloads": -1, "filename": "van.static-0.1.tar.gz", "has_sig": false, "md5_digest": "94b76277085b038c007f7cca76725d73", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5851, "upload_time": "2011-12-21T12:22:02", "url": "https://files.pythonhosted.org/packages/72/8e/841a940bf5cd3aa5dead297da5a142e352032d5c272ed4bfe189120a3f4e/van.static-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "e8f560a6f1b7d49e089c8ee82ed57dbf", "sha256": "cdbe2f7f6c1be23289512d4cc7a0a4fa906a1b07f91f6b76b107e442417ae38d" }, "downloads": -1, "filename": "van.static-0.2.tar.gz", "has_sig": false, "md5_digest": "e8f560a6f1b7d49e089c8ee82ed57dbf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11041, "upload_time": "2011-12-26T10:17:38", "url": "https://files.pythonhosted.org/packages/07/d8/11fecfd787a71cc11a517aac62a3d62874157b5e19590d8bcb8124d506c7/van.static-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "0215a9ca9c483a98d757bff08e0caf48", "sha256": "6d568a1c54de6491a0d2e320c1a83082f2cd356ac8c043859d7fd1312ceca9ee" }, "downloads": -1, "filename": "van.static-0.3.tar.gz", "has_sig": false, "md5_digest": "0215a9ca9c483a98d757bff08e0caf48", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12416, "upload_time": "2012-01-02T09:17:41", "url": "https://files.pythonhosted.org/packages/d0/fb/c48b6e59968aa26a419b21e5755914e58addb4428579dcd383ff7bd0cb52/van.static-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "a01877489efa956d97be11fef31177e3", "sha256": "7e93dd5d66cf50d93a6b40fba7c519fdf8e76beefcb04b9139b3b2973278ad97" }, "downloads": -1, "filename": "van.static-0.4.tar.gz", "has_sig": false, "md5_digest": "a01877489efa956d97be11fef31177e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12423, "upload_time": "2012-01-06T10:22:04", "url": "https://files.pythonhosted.org/packages/46/82/e33b7e3839bf9b88046bdb63712f3685316ddaeb57e12d1ace9f1362cac7/van.static-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "0187b5ce655f9d09aa2d62e79f10d6b4", "sha256": "e29eff7e469638472faebd38d06547543ce8d7426191db0c8daa062b023a8f5e" }, "downloads": -1, "filename": "van.static-0.5.tar.gz", "has_sig": false, "md5_digest": "0187b5ce655f9d09aa2d62e79f10d6b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12618, "upload_time": "2012-01-12T08:49:59", "url": "https://files.pythonhosted.org/packages/5e/96/9413244aea04db9b1d0ded71170014e42e9758737765c90f8f8f823ee894/van.static-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "34802a6a5a08a09c764797b8434563ea", "sha256": "182158c5e839d7032e173ca78f7a6bb13a7af881014a81fbf05cf6081ece7352" }, "downloads": -1, "filename": "van.static-0.6.tar.gz", "has_sig": false, "md5_digest": "34802a6a5a08a09c764797b8434563ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13083, "upload_time": "2012-01-13T15:13:54", "url": "https://files.pythonhosted.org/packages/bf/1d/b5c4ff6faae61b2fa108a251cda20cf47de3f2725c77f829639dc55422ab/van.static-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "a9762804fc35633057e60dd42a1bd908", "sha256": "0117b50bf8a8b790f1f94265e895ad9fa6e98344e84ba583ef652c9bfb9ac83e" }, "downloads": -1, "filename": "van.static-0.7.tar.gz", "has_sig": false, "md5_digest": "a9762804fc35633057e60dd42a1bd908", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13245, "upload_time": "2012-01-13T15:51:14", "url": "https://files.pythonhosted.org/packages/e1/f5/ab3e0d358aec81ca240af9f0a60701ed9b13c12e8707ac94f688b87209b2/van.static-0.7.tar.gz" } ], "0.8": [ { "comment_text": "", "digests": { "md5": "0a372e5436689c85d89b63efba859cd0", "sha256": "77b9d976d81166f752aef0df6aae8b855203079114d422049afab22a3b89feb2" }, "downloads": -1, "filename": "van.static-0.8.tar.gz", "has_sig": false, "md5_digest": "0a372e5436689c85d89b63efba859cd0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14538, "upload_time": "2012-02-10T19:24:08", "url": "https://files.pythonhosted.org/packages/19/f4/ffbaf93921b788aecac5ad45c6ed5d35a5da643ed5532609786cdcc17b18/van.static-0.8.tar.gz" } ], "0.9": [ { "comment_text": "", "digests": { "md5": "6ab7aafc8d5e50544a079e83e4ce9c8e", "sha256": "a3241a310f0247b7ab5acbf316f0cea87d2ff2257d685dfc962e39012326798a" }, "downloads": -1, "filename": "van.static-0.9.tar.gz", "has_sig": false, "md5_digest": "6ab7aafc8d5e50544a079e83e4ce9c8e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16169, "upload_time": "2012-03-31T20:06:16", "url": "https://files.pythonhosted.org/packages/48/21/a8ad1c52ebb3de754b0d44177a60de80c6128e669de9368f44b21cf89f11/van.static-0.9.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "682abde7d6ac2bffff1ad6a08c9bad67", "sha256": "eef28a875609946812bdf55ecb539dad9be7a15ac058c4e7dc821232b2905859" }, "downloads": -1, "filename": "van.static-1.0.tar.gz", "has_sig": false, "md5_digest": "682abde7d6ac2bffff1ad6a08c9bad67", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16151, "upload_time": "2012-03-31T20:09:40", "url": "https://files.pythonhosted.org/packages/09/75/6f77ae4f1ef99f67b5f8ab8632c3cbdab7d3ce803a76c7c9dd131cca6122/van.static-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "287dbaf96c551ea1d74ceb065f0756ec", "sha256": "718dbe3e4b32d3fae98da0aeac8838d4776614ad4d3a7c0619acc71e3e140f89" }, "downloads": -1, "filename": "van.static-1.1.tar.gz", "has_sig": false, "md5_digest": "287dbaf96c551ea1d74ceb065f0756ec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20422, "upload_time": "2012-11-23T00:38:08", "url": "https://files.pythonhosted.org/packages/78/7d/c42cdc101b18775e2a694848f26050ddfca12b10efee037ef3f789d6cab2/van.static-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "9a6a4dee24899b113b7988aecca3f88c", "sha256": "783322f7a36633f2b8982fb885784a6179e195c936d817fd3dc94bdd8ab827ff" }, "downloads": -1, "filename": "van.static-1.2.tar.gz", "has_sig": false, "md5_digest": "9a6a4dee24899b113b7988aecca3f88c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20536, "upload_time": "2012-11-26T00:10:23", "url": "https://files.pythonhosted.org/packages/21/42/d320a9f8a1078a131dbf379fc6404b326c54710ca40dfd737d52ae4feefa/van.static-1.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "7eedecfbb7f232375f3c2bb8f0d56817", "sha256": "53fdc2d94df8dc8218eb510c9b4702d23824f4354e3c6b8651caef0a40e46381" }, "downloads": -1, "filename": "van.static-1.3.tar.gz", "has_sig": false, "md5_digest": "7eedecfbb7f232375f3c2bb8f0d56817", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21536, "upload_time": "2013-11-21T13:34:49", "url": "https://files.pythonhosted.org/packages/3c/0e/5fc7f9bce92f5de09446c4a409fa9d57ef2486d73efd7c0cd60d199ef69b/van.static-1.3.tar.gz" } ], "1.5": [ { "comment_text": "", "digests": { "md5": "aae7605397778e07a71cc0191dc5105e", "sha256": "4135abdd4c4d7296234d1513845b8fc1ec942fd1c22c3ca80af0bcf1f84d7c15" }, "downloads": -1, "filename": "van.static-1.5.tar.gz", "has_sig": false, "md5_digest": "aae7605397778e07a71cc0191dc5105e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21537, "upload_time": "2016-11-03T14:58:01", "url": "https://files.pythonhosted.org/packages/65/ad/c5932f64595e1b7aee9b419dbb162bab141fcf981ae29e0a716035724340/van.static-1.5.tar.gz" } ], "1.6": [ { "comment_text": "", "digests": { "md5": "96a1a8112a767e3fbd78552cab669a58", "sha256": "655cd76108f24b6082e0ffd6515f169ba0af4ad74449724cc07abfa3dcf51e43" }, "downloads": -1, "filename": "van.static-1.6.tar.gz", "has_sig": false, "md5_digest": "96a1a8112a767e3fbd78552cab669a58", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21528, "upload_time": "2016-11-04T10:29:57", "url": "https://files.pythonhosted.org/packages/37/e4/394bcc07ecf9db76132bf817db8c96967d85ddb336ab4b58f69c337f25e9/van.static-1.6.tar.gz" } ], "1.7": [ { "comment_text": "", "digests": { "md5": "10b32e0b61afe2daef6ba199ecfb2d26", "sha256": "18f926ff3d401f197cbdce8dbfffb7fa49c49651e24dcfbd276eb4cba4366c95" }, "downloads": -1, "filename": "van.static-1.7.tar.gz", "has_sig": false, "md5_digest": "10b32e0b61afe2daef6ba199ecfb2d26", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21537, "upload_time": "2016-11-04T10:45:11", "url": "https://files.pythonhosted.org/packages/3f/bc/6bb30ffef31f92cbc4d36856afd784e9114306391c587ff3bfa2c47c6eb0/van.static-1.7.tar.gz" } ], "1.8": [ { "comment_text": "", "digests": { "md5": "9b2010515eeb273d6532aa7d0a358995", "sha256": "f0b118529e7703d987ce16dbc2fea6263e61c71f2bd3c1f342ed8b2d0350f071" }, "downloads": -1, "filename": "van.static-1.8.tar.gz", "has_sig": false, "md5_digest": "9b2010515eeb273d6532aa7d0a358995", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21547, "upload_time": "2016-11-04T15:25:28", "url": "https://files.pythonhosted.org/packages/c7/60/e89a71eb159e1c2cbf51b288971cdcabb6a297036545e68522bdccfe73b6/van.static-1.8.tar.gz" } ], "1.9": [ { "comment_text": "", "digests": { "md5": "6d83152c61f20517a36fd854a35a3a7d", "sha256": "7ba4e232704205d93a2f1ea80f4e6e389c0503e2d232e998be40863feccaf19c" }, "downloads": -1, "filename": "van.static-1.9.tar.gz", "has_sig": false, "md5_digest": "6d83152c61f20517a36fd854a35a3a7d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20755, "upload_time": "2018-05-16T16:21:14", "url": "https://files.pythonhosted.org/packages/d0/ac/a09df53514ab7416c8afc2990f5f650f06c4edec01cde3ce9a12fde658b2/van.static-1.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6d83152c61f20517a36fd854a35a3a7d", "sha256": "7ba4e232704205d93a2f1ea80f4e6e389c0503e2d232e998be40863feccaf19c" }, "downloads": -1, "filename": "van.static-1.9.tar.gz", "has_sig": false, "md5_digest": "6d83152c61f20517a36fd854a35a3a7d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20755, "upload_time": "2018-05-16T16:21:14", "url": "https://files.pythonhosted.org/packages/d0/ac/a09df53514ab7416c8afc2990f5f650f06c4edec01cde3ce9a12fde658b2/van.static-1.9.tar.gz" } ] }