{ "info": { "author": "Dave Hall", "author_email": "dave@etianen.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Internet :: WWW/HTTP" ], "description": "django-require\n==============\n\n**django-require** is a Django staticfiles post-processor for optimizing\nwith `RequireJS `_.\n\nFeatures\n--------\n\n- Optimize your static assets using the excellent r.js optimizer.\n- Compile standalone modules using the\n `almond.js `_ shim.\n- Compatible with any Django staticfiles storage backend.\n\nInstallation\n------------\n\n1. Checkout the latest django-require release and copy or symlink the\n ``require`` directory into your ``PYTHONPATH``. If using pip, run\n ``pip install django-require``.\n2. Add ``'require'`` to your ``INSTALLED_APPS`` setting.\n3. Set your ``STATICFILES_STORAGE`` setting to\n ``'require.storage.OptimizedStaticFilesStorage'``,\n ``'require.storage.OptimizedCachedStaticFilesStorage'`` or\n ``'require.storage.OptimizedManifestStaticFilesStorage'``.\n\nAvailable settings\n------------------\n\nAvailable settings, and their default values, are shown below. You\nshould configure this to match the layout of your project's static\nfiles. Please consult the `RequireJS `_\ndocumentation for more information about how to build javascript using\nRequireJS.\n\n.. code:: python\n\n # The baseUrl to pass to the r.js optimizer, relative to STATIC_ROOT.\n REQUIRE_BASE_URL = \"js\"\n\n # The name of a build profile to use for your project, relative to REQUIRE_BASE_URL.\n # A sensible value would be 'app.build.js'. Leave blank to use the built-in default build profile.\n # Set to False to disable running the default profile (e.g. if only using it to build Standalone\n # Modules)\n REQUIRE_BUILD_PROFILE = None\n\n # The name of the require.js script used by your project, relative to REQUIRE_BASE_URL.\n REQUIRE_JS = \"require.js\"\n\n # A dictionary of standalone modules to build with almond.js.\n # See the section on Standalone Modules, below.\n REQUIRE_STANDALONE_MODULES = {}\n\n # Whether to run django-require in debug mode.\n REQUIRE_DEBUG = settings.DEBUG\n\n # A tuple of files to exclude from the compilation result of r.js.\n REQUIRE_EXCLUDE = (\"build.txt\",)\n\n # The execution environment in which to run r.js: auto, node or rhino.\n # auto will auto-detect the environment and make use of node if available and rhino if not.\n # It can also be a path to a custom class that subclasses\n # require.environments.Environment and defines some \"args\" function that\n # returns a list with the command arguments to execute.\n REQUIRE_ENVIRONMENT = \"auto\"\n\nGenerating require.js\n---------------------\n\nAs a shortcut to downloading a copy of require.js from the internet, you\ncan simply run the ``require_init`` management to copy a version of\nrequire.js into your ``STATICFILES_DIRS``, at the location specified by\nyour ``REQUIRE_BASE_URL`` and ``REQUIRE_JS`` settings.\n\n.. code:: bash\n\n $ ./manage.py require_init\n\nGenerating build profiles\n-------------------------\n\nIn almost all cases, you'll want to create a custom build profile for\nyour project. To help you get started, django-require can generate a\ndefault build profile into your ``STATICFILES_DIRS``. Just set your\n``REQUIRE_BUILD_PROFILE`` setting to a build profile name, and run\n``require_init``. A good name for a build profile would be\n``'app.build.js'``.\n\nAny standalone modules that your specify with a build profile will also\nhave a default build profile generated when you run this command.\n\nRunning javascript modules in templates\n---------------------------------------\n\nYou can run javascript modules in templates by using the\n``{% require_module %}`` template tag.\n\n.. code:: html\n\n \n {% load require %}\n \n {% require_module 'main' %}\n \n \n \n\nThis template fragment would then render to something like:\n\n.. code:: html\n\n \n \n \n \n \n \n\nIf the ``'main'`` module was specified as a standalone module in your\n``REQUIRE_STANDALONE_MODULES`` setting, and ``REQUIRE_DEBUG`` is\n``False``, then the template fragment would instead render as:\n\nThis template fragment would then render to something like:\n\n.. code:: html\n\n \n \n \n \n \n \n\nBuilding standalone modules\n---------------------------\n\nAs a further optimization to your code, you can build your modules to\nrun independently of require.js, which can often speed up page load\ntimes. Standalone modules are built using the almond.js shim, so consult\nthe `almond.js `_ documentation to\nmake sure that it's safe to build your module in standalone mode.\n\nTo specify standalone modules, simply add them to your\n``REQUIRE_STANDALONE_MODULES`` setting, as below:\n\n.. code:: python\n\n REQUIRE_STANDALONE_MODULES = {\n \"main\": {\n # Where to output the built module, relative to REQUIRE_BASE_URL.\n \"out\": \"main-built.js\",\n\n # Optional: A build profile used to build this standalone module.\n \"build_profile\": \"main.build.js\",\n }\n }\n\nRunning the r.js optimizer\n--------------------------\n\nThe r.js optimizer is run automatically whenever you call the\n``collectstatic`` management command. The optimizer is run as a\npost-processing step on your static files.\n\ndjango-require provides three storage classes that are ready to use with\nthe r.js optimizer:\n\n- ``require.storage.OptimizedStaticFilesStorage`` - A filesystem-based\n storage that runs the r.js optimizer.\n- ``require.storage.OptimizedCachedStaticFilesStorage`` - As above, but\n fingerprints all files with an MD5 hash of their contents for HTTP\n cache-busting.\n- ``require.storage.OptimizedManifestStaticFilesStorage`` - As above, but\n fingerprints all files with an MD5 hash of their contents for HTTP\n cache-busting and stores the fingerprints in a JSON file on disk instead\n of using a cache. Please note that the\n ``OptimizedManifestStaticFilesStorage`` is only available in Django 1.7 and\n above.\n\nCreating your own optimizing storage classes\n--------------------------------------------\n\nYou can add r.js optimization to any Django staticfiles storage class by\nusing the ``require.storage.OptimizedFilesMixin``. For example, to make\nan optimizing storage that uploads to Amazon S3 using ``S3BotoStorage``\nfrom\n`django-storages `_:\n\n.. code:: python\n\n from storages.backends.s3boto import S3BotoStorage\n from require.storage import OptimizedFilesMixin\n\n # S3 storage with r.js optimization.\n class OptimizedS3BotoStorage(OptimizedFilesMixin, S3BotoStorage):\n pass\n\n # S3 storage with r.js optimization and MD5 fingerprinting.\n from django.contrib.staticfiles.storage import CachedFilesMixin\n class OptimizedCachedS3BotoStorage(OptimizedFilesMixin, CachedFilesMixin, S3BotoStorage):\n pass\n\nFor ready-made storage classes that combine django-require with Amazon S3, check out\n`django-require-s3 `_.\n\nOther projects extending django-require\n---------------------------------------\n\n- `django-require-license `_ - prepends a license header to compressed file(s) generated with django-require\n\nTests\n-----\n\nYou can run the test suite from the root of the source checkout::\n\n test_project/manage.py test require\n\nTest coverage reports can be generated from the same directory with::\n\n coverage run --source='.' test_project/manage.py test require\n coverage html\n\nOpen `htmlcov/index.html` in a browser to see the HTML coverage report.\n\nSupport and announcements\n-------------------------\n\nDownloads and bug tracking can be found at the `main project\nwebsite `_.\n\nYou can keep up to date with the latest announcements by joining the\n`django-require discussion\ngroup `_.\n\nMore information\n----------------\n\nThe django-require project was developed by Dave Hall. You can get the\ncode from the `django-require project\nsite `_.\n\nDave Hall is a freelance web developer, based in Cambridge, UK. You can\nusually find him on the Internet in a number of different places:\n\n- `Website `_\n- `Twitter `_\n- `Google Profile `_\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/etianen/django-require", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-require", "package_url": "https://pypi.org/project/django-require/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-require/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/etianen/django-require" }, "release_url": "https://pypi.org/project/django-require/1.0.11/", "requires_dist": null, "requires_python": null, "summary": "A Django staticfiles post-processor for optimizing with RequireJS.", "version": "1.0.11" }, "last_serial": 2295189, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "42303c425dc94caf1e073944bb65bb7d", "sha256": "118b8bde0ad7a678cbf602c41ec4ca536c948a5ae69fb82f3b82d0b01fe14a58" }, "downloads": -1, "filename": "django-require-1.0.0.tar.gz", "has_sig": false, "md5_digest": "42303c425dc94caf1e073944bb65bb7d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5698222, "upload_time": "2012-11-01T18:23:57", "url": "https://files.pythonhosted.org/packages/53/8d/bb3b70d840247721859556a49e4ee21a39f610b65b22d6a2ffbd542c4936/django-require-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "70f37c2f17ed29186f3b2d3440eb4cb5", "sha256": "51f5d7123e843634b1d41f3a88b58e94773ae5b05ab62c7528dae61f72511972" }, "downloads": -1, "filename": "django-require-1.0.1.tar.gz", "has_sig": false, "md5_digest": "70f37c2f17ed29186f3b2d3440eb4cb5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5756953, "upload_time": "2012-11-30T11:47:00", "url": "https://files.pythonhosted.org/packages/61/fa/937eb85aa757d1a1b29f4f35c539128f8087953f0c50dfc3593e50605d27/django-require-1.0.1.tar.gz" } ], "1.0.10": [ { "comment_text": "", "digests": { "md5": "d1187c0ca4b67362a85b11b3659f9b4d", "sha256": "bb705889731cacfde29396174c273d8eff32a285eb041a46547406b1382abe5d" }, "downloads": -1, "filename": "django-require-1.0.10.tar.gz", "has_sig": false, "md5_digest": "d1187c0ca4b67362a85b11b3659f9b4d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7183767, "upload_time": "2016-02-15T14:09:40", "url": "https://files.pythonhosted.org/packages/07/28/acfd9e72c3c4f5788c95d56b2cbe0d0ac8254098f31830a57686942a2a01/django-require-1.0.10.tar.gz" } ], "1.0.11": [ { "comment_text": "", "digests": { "md5": "fae5702fab00143a1ed7227064c867ec", "sha256": "01c4c48ee60753ca4485c1de8096d2af63d53d0198f53ca8564edb5ba33b166e" }, "downloads": -1, "filename": "django-require-1.0.11.tar.gz", "has_sig": false, "md5_digest": "fae5702fab00143a1ed7227064c867ec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7183759, "upload_time": "2016-08-22T10:22:31", "url": "https://files.pythonhosted.org/packages/f0/2e/79046f2c90c50506e934eec52cb1503f1e07a8d4c4d621ea257ba83ba5de/django-require-1.0.11.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "c3aec0b8ca398d878bed7a7d19241e54", "sha256": "f4fb6400b5d0100dac21720c619b45439cdea476ba7e8231ad1252cea27ce0b2" }, "downloads": -1, "filename": "django-require-1.0.2.tar.gz", "has_sig": false, "md5_digest": "c3aec0b8ca398d878bed7a7d19241e54", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6731565, "upload_time": "2013-02-25T11:40:28", "url": "https://files.pythonhosted.org/packages/0f/57/d5b37149a41418efee1163e8773552892b7825628f24eb9e718bc36ed64c/django-require-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "c3e9b389d379475829174c68cffecf82", "sha256": "f46670ec5a690944a158d3415e57ec12a39bbf9a688325747dc7b779e4422bfc" }, "downloads": -1, "filename": "django-require-1.0.3.tar.gz", "has_sig": false, "md5_digest": "c3e9b389d379475829174c68cffecf82", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7018151, "upload_time": "2013-04-25T09:02:00", "url": "https://files.pythonhosted.org/packages/45/50/e2d63375c7528febc7616bc767ca51ac90eeb866884328ebfc19e4d2fa1f/django-require-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "60b728cbe0927eb2f408dfb0e773550d", "sha256": "23d43958d9fed8c7324dc27d6e4943469d66b7188eefaf53cd73cb7fe28167a2" }, "downloads": -1, "filename": "django-require-1.0.4.tar.gz", "has_sig": true, "md5_digest": "60b728cbe0927eb2f408dfb0e773550d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7097234, "upload_time": "2013-07-27T13:55:36", "url": "https://files.pythonhosted.org/packages/7a/f5/888b4cb004131d547f0f67b835ec53a9842d1792421bc7214b6300db456d/django-require-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "b4ffec4ed64cd227bc77b370c59d0362", "sha256": "3ed4647e43f8d5c3decb82bc822879bf3c52e7a69facee3864b53f56ae960312" }, "downloads": -1, "filename": "django-require-1.0.5.tar.gz", "has_sig": false, "md5_digest": "b4ffec4ed64cd227bc77b370c59d0362", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7097421, "upload_time": "2013-11-12T12:14:57", "url": "https://files.pythonhosted.org/packages/00/39/039828a5caf4fa59f3362f77fe3e8d2018191a651f3c78bf60b9b8f261c4/django-require-1.0.5.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "92c730f353c927f9cbfbed50b4097a77", "sha256": "47355a01fecc45afe6fecc2fa50c0b9ab52e8267ccebff6c008a0562df9e77d5" }, "downloads": -1, "filename": "django-require-1.0.6.tar.gz", "has_sig": false, "md5_digest": "92c730f353c927f9cbfbed50b4097a77", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7544463, "upload_time": "2014-04-11T08:49:52", "url": "https://files.pythonhosted.org/packages/b7/92/78500e74fabc978528377ee3ace198739e021832b0c2e694f0dcc994a1fc/django-require-1.0.6.tar.gz" } ], "1.0.7": [ { "comment_text": "", "digests": { "md5": "0198f5323c8b5a79a3b21921c1234f85", "sha256": "c67815fc4c7f2148300d7dd412a02d410cf0962bc045939f87a8d896a22a64c6" }, "downloads": -1, "filename": "django-require-1.0.7.tar.gz", "has_sig": false, "md5_digest": "0198f5323c8b5a79a3b21921c1234f85", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6995428, "upload_time": "2015-02-26T10:14:44", "url": "https://files.pythonhosted.org/packages/f9/e3/42d30471817e3771a07e02f13052f5e36639d05d251b53c087b3b4c374e7/django-require-1.0.7.tar.gz" } ], "1.0.8": [ { "comment_text": "", "digests": { "md5": "7e5b199a912adcc81abb7d4257f8a404", "sha256": "4dacca943152afe92278c5f664b7f97f8c379a8f0ee75a4a228e3c85a722f03d" }, "downloads": -1, "filename": "django-require-1.0.8.tar.gz", "has_sig": false, "md5_digest": "7e5b199a912adcc81abb7d4257f8a404", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7001968, "upload_time": "2015-06-30T10:26:50", "url": "https://files.pythonhosted.org/packages/d2/f0/6a7ac0c29755c02e2bf63a609eee31cb51ba7855f9697266ff0c1eb9cc95/django-require-1.0.8.tar.gz" } ], "1.0.9": [ { "comment_text": "", "digests": { "md5": "90f247a371072669a58f5cb9d3849387", "sha256": "bc1aebf5a5ab56275e2dd5a82cba5f2e5b9714f2af54d7969142d709cfa35d74" }, "downloads": -1, "filename": "django-require-1.0.9.tar.gz", "has_sig": false, "md5_digest": "90f247a371072669a58f5cb9d3849387", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7183585, "upload_time": "2016-01-04T14:46:16", "url": "https://files.pythonhosted.org/packages/bd/9a/831062ba10c7b3f009f22d1abc81997c8234cf9ec5387275635f0012254c/django-require-1.0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fae5702fab00143a1ed7227064c867ec", "sha256": "01c4c48ee60753ca4485c1de8096d2af63d53d0198f53ca8564edb5ba33b166e" }, "downloads": -1, "filename": "django-require-1.0.11.tar.gz", "has_sig": false, "md5_digest": "fae5702fab00143a1ed7227064c867ec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7183759, "upload_time": "2016-08-22T10:22:31", "url": "https://files.pythonhosted.org/packages/f0/2e/79046f2c90c50506e934eec52cb1503f1e07a8d4c4d621ea257ba83ba5de/django-require-1.0.11.tar.gz" } ] }