{ "info": { "author": "Martin Blech", "author_email": "martinblech@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Internet :: WWW/HTTP" ], "description": "django-critical\n===============\n\nInlines critical path CSS and defers loading full CSS asynchronously.\n\nHow it works\n------------\n\n`django-critical` parses the HTML between `{% critical %}` and `{% endcritical\n%}` and searches for CSS.\n\n```html\n{% critical %}\n\n\n{% endcritical %}\n```\n\nIt downloads and concatenates all CSS that it finds and uses\n[penthouse](https://github.com/pocketjoso/penthouse/) to extract the\ncritical path CSS rules from it, which end up inlined and minified in place of\nthe original CSS.\n\n```html\n\n```\n\nLater in the HTML, before the closing `` tag, the `{% critical_async %}`\ntemplate tag takes care of loading the rest of the CSS using FilamentGroup's\n[loadCSS](https://github.com/filamentgroup/loadCSS).\n\nInstallation\n------------\n\n* Install `django-critical`:\n\n```sh\npip install django-critical\n```\n\n* Add `critical` to your `INSTALLED_APPS` setting:\n\n```python\nINSTALLED_APPS = (\n # other apps\n \"critical\",\n)\n```\n\n* Add `critical.middleware.CriticalCssMiddleware` to your `MIDDLEWARE_CLASSES`\n setting:\n\n```python\nMIDDLEWARE_CLASSES = (\n # other middlewares\n \"critical.middleware.CriticalCssMiddleware\",\n)\n```\n\n* Point your `CRITICAL_PENTHOUSE_PATH` setting to the correct path, e.g.:\n\n```python\nCRITICAL_PENTHOUSE_PATH = os.path.join(\n BASE_DIR, 'node_modules/penthouse/penthouse.js')\n```\n\nCaching\n-------\n\n`django-critical` calculates the critical path CSS for the first request, caches\nthe result and reuses this CSS verbatim for further requests. Most web\napplications have different critical path CSS for different groups of pages,\nthough. This can be solved using the `{% critical_key \"\" %}` template tag,\nso that different templates can have different caching keys.\n\nIs this stable and ready for production use?\n--------------------------------------------\n\nNo. `django-critical` is in a very early stage of development, so you should use\nit at your own risk. [Bug\nreports](https://github.com/martinblech/django-critical/issues) and\n[contributions](https://github.com/martinblech/django-critical/pulls) are\nwelcome, though!", "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/martinblech/django-critical", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "django-critical", "package_url": "https://pypi.org/project/django-critical/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-critical/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/martinblech/django-critical" }, "release_url": "https://pypi.org/project/django-critical/0.1/", "requires_dist": null, "requires_python": null, "summary": "Inlines critical path CSS and defers loading full CSS asynchronously.", "version": "0.1" }, "last_serial": 1180280, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "dcfe0392f4c1360bacb62c41fe2dd97d", "sha256": "abf0c3be5c3d5804835e6642196195e3c70cbd35e127f5c63af751f0719a4e96" }, "downloads": -1, "filename": "django-critical-0.1.tar.gz", "has_sig": false, "md5_digest": "dcfe0392f4c1360bacb62c41fe2dd97d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6445, "upload_time": "2014-08-05T05:12:09", "url": "https://files.pythonhosted.org/packages/27/9c/80ca4b48f881bcbfe42fb1769ebb312aff5a80a93112139937df16e23b90/django-critical-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dcfe0392f4c1360bacb62c41fe2dd97d", "sha256": "abf0c3be5c3d5804835e6642196195e3c70cbd35e127f5c63af751f0719a4e96" }, "downloads": -1, "filename": "django-critical-0.1.tar.gz", "has_sig": false, "md5_digest": "dcfe0392f4c1360bacb62c41fe2dd97d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6445, "upload_time": "2014-08-05T05:12:09", "url": "https://files.pythonhosted.org/packages/27/9c/80ca4b48f881bcbfe42fb1769ebb312aff5a80a93112139937df16e23b90/django-critical-0.1.tar.gz" } ] }