{"_id":"django-js-reverse","_rev":"4-3ed775035ae0761d73a892b99e2aeab8","name":"django-js-reverse","dist-tags":{"latest":"0.10.1-a.0"},"versions":{"0.0.0":{"author":{"name":"Bernhard Janetzki"},"bugs":{"url":"https://github.com/ierror/django-js-reverse/issues"},"description":"JavaScript url handling for Django that doesn't hurt.","homepage":"https://github.com/ierror/django-js-reverse#readme","keywords":["django","js","reverse","url"],"license":"MIT","main":"index.js","name":"django-js-reverse","repository":{"type":"git","url":"git://github.com/ierror/django-js-reverse.git"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"version":"0.0.0","contributors":[{"name":"Maintainers"},{"name":"-----------"},{"name":"* [Bernhard Janetzki]","url":"https://github.com/ierror"},{"name":"Contributors"},{"name":"------------"},{"name":"* [Kuntelin]","url":"https://github.com/kuntelin"},{"name":"* [metalpriest]","url":"https://github.com/metalpriest"},{"name":"* [emcsween]","url":"https://github.com/emcsween"},{"name":"* [hyperair]","url":"https://github.com/hyperair"},{"name":"* [Andertaker]","url":"https://github.com/Andertaker"},{"name":"* [bulv1ne]","url":"https://github.com/bulv1ne"},{"name":"* [logston]","url":"https://github.com/logston"},{"name":"* [aumo]","url":"https://github.com/aumo"},{"name":"* [defrex]","url":"https://github.com/defrex"},{"name":"* [michael-borisov]","url":"https://github.com/michael-borisov"},{"name":"* [chripede]","url":"https://github.com/chripede"},{"name":"* [mjnaderi]","url":"https://github.com/mjnaderi"},{"name":"* [BrnoPCmaniak]","url":"https://github.com/BrnoPCmaniak"},{"name":"* [razh]","url":"https://github.com/razh"},{"name":"* [ghedsouza]","url":"https://github.com/ghedsouza"},{"name":"* [karamanolev]","url":"https://github.com/karamanolev"},{"name":"* [wlonk]","url":"https://github.com/wlonk>"},{"name":"* [kavdev]","url":"https://github.com/kavdev"}],"gitHead":"72865b8ec757a9334900a8dc48214ba6a02ae5c8","_id":"django-js-reverse@0.0.0","_npmVersion":"6.2.0","_nodeVersion":"10.9.0","_npmUser":{"name":"graingert","email":"tagrain@gmail.com"},"dist":{"integrity":"sha512-gif1CTS+V26z8rRXrDdhLRzCJGd7VfD0Cwq9AYigk07RD1jAW8F/5DDhiYlknkPJAGkD3Rfr8u6doAfuWJjpOw==","shasum":"e74dbcfa0f2d898a8c169bf5e754e6486829fcf4","tarball":"https://registry.npmjs.org/django-js-reverse/-/django-js-reverse-0.0.0.tgz","fileCount":6,"unpackedSize":21074,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbksROCRA9TVsSAnZWagAA9A0P/0AL08zBmazliXMeChKR\nFZK/OnGzu42zrl8nDRiIoD8+2pu4Fq8AzdCYvNEebm2ryGMM7qgP98wxRhfG\nmqkvrWUpYwYQHlBEG53C2/FwT9/3PMqGvHsLGRuuU+jDZp/HGkgg1baaPUNC\nTDsrqOiogIp1eFlpkSZpdCa/sg70Bw4J4UJkTRWcGJP7EtZwfIIpeepdZss0\nsmvEshkgKMdP9PIojPWbJVz7Y/Hn2/EhOzKyv9k2B001czzVIu95jHGD+c4V\nqgw9AG7De222FpVnk22DDFXpOQYLsWpcjSIB6K3c5jXc8XAa+s3lHg4f5yVC\nAzoCuem5gv8cWx5UdIM1xhjH7gcA/YRFfHIAH3vK7tIiVsItlFevmsKSATB0\nIdh8qlXlUMdU/+TQUzHhsQfdALyKuS14veF7b3cRONlx0GPg3TLba272YsLx\nKEVSqrDQuxutQnSLgXtKGPq+za8hjyxoWjh4I8led+7OoVsbcNryZ4wymmxi\nn0UjP3t2xH4SJW7lrxSbXmu81zJYoxYh6u9+H8pxuoqwXP7a49xW0xsPrZu/\nsVPFsK/9imwVhqey6TV92/ICSvwsWM+KSKk6nLalpo08jW5rLLMZYz/wupBi\nbUv5me30RXEaBl/DGLqx+YuyXMJnxsLtdFhA/Z2XrYt5HcbW295Mp8HH9aiF\noHdM\r\n=xEVC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFnqYjg2xhtSzRXXifZGBZ5V4oUoI6g9Dg5CZDwZv/aWAiAWM+7gg6utR3PJQHLSi3qEluaFY95bCeukYrrI4A6STw=="}]},"maintainers":[{"name":"graingert","email":"tagrain@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/django-js-reverse_0.0.0_1536345166296_0.28448005434074597"},"_hasShrinkwrap":false},"0.0.1-alpha":{"author":{"name":"Bernhard Janetzki"},"bugs":{"url":"https://github.com/ierror/django-js-reverse/issues"},"description":"JavaScript url handling for Django that doesn't hurt.","homepage":"https://github.com/ierror/django-js-reverse#readme","keywords":["django","js","reverse","url"],"license":"MIT","main":"index.js","name":"django-js-reverse","repository":{"type":"git","url":"git://github.com/ierror/django-js-reverse.git"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"version":"0.0.1-alpha","contributors":[{"name":"Maintainers"},{"name":"-----------"},{"name":"* [Bernhard Janetzki]","url":"https://github.com/ierror"},{"name":"Contributors"},{"name":"------------"},{"name":"* [Kuntelin]","url":"https://github.com/kuntelin"},{"name":"* [metalpriest]","url":"https://github.com/metalpriest"},{"name":"* [emcsween]","url":"https://github.com/emcsween"},{"name":"* [hyperair]","url":"https://github.com/hyperair"},{"name":"* [Andertaker]","url":"https://github.com/Andertaker"},{"name":"* [bulv1ne]","url":"https://github.com/bulv1ne"},{"name":"* [logston]","url":"https://github.com/logston"},{"name":"* [aumo]","url":"https://github.com/aumo"},{"name":"* [defrex]","url":"https://github.com/defrex"},{"name":"* [michael-borisov]","url":"https://github.com/michael-borisov"},{"name":"* [chripede]","url":"https://github.com/chripede"},{"name":"* [mjnaderi]","url":"https://github.com/mjnaderi"},{"name":"* [BrnoPCmaniak]","url":"https://github.com/BrnoPCmaniak"},{"name":"* [razh]","url":"https://github.com/razh"},{"name":"* [ghedsouza]","url":"https://github.com/ghedsouza"},{"name":"* [karamanolev]","url":"https://github.com/karamanolev"},{"name":"* [wlonk]","url":"https://github.com/wlonk>"},{"name":"* [kavdev]","url":"https://github.com/kavdev"}],"gitHead":"ae294155ecfbfefc710415395650327c4eb19ffd","_id":"django-js-reverse@0.0.1-alpha","_npmVersion":"6.4.1","_nodeVersion":"10.10.0","_npmUser":{"name":"graingert","email":"tagrain@gmail.com"},"dist":{"integrity":"sha512-JL6qSnV/WKppW6kGvMyS9QtVFb1naXp8bAk0i8qKKyFn6d38JRVIpB5t2vZJBR+hDVPLo7yDhd265KF0iKSPaQ==","shasum":"7774d6c196eb0bd63fdb7c120ad2799d0627482b","tarball":"https://registry.npmjs.org/django-js-reverse/-/django-js-reverse-0.0.1-alpha.tgz","fileCount":6,"unpackedSize":22102,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbl9uRCRA9TVsSAnZWagAAG20QAJWwyuddHYOauxKRaPgS\nyFLq1BL6dTfn6itZv05Q5kqLqB3ZaP2b83VrYdEkJzADOhEyv7uSyGBPvVsq\ntQCPK3UhFkoGJak08LNNHh+tBCtcwn7tyGPTTCMfJ0e22W6oInzrYbP6K/ft\ngG2Oi5iiN6QF4ze1IY0GZQ+89Yst9/U1IKNiEUiWDAnBUR315lJ0DZBDrcpj\n5YyIblSSgIOnRa0WiDItUBrtH7Yj7es7GwJLl/gX/ED18rdSnenAb7mR+b6A\nDTNy/ic2rXQ4HBzIYD07zMvxhD3JSWBS1nHCKxOPo4XrWTTwMAjV4OT4E3+1\nVE8C0zADg0C5YPp2ETXnlrcfahViHdRpNFBeeJGB3jDm1oyfPhDP6tQkbVSs\nIECiUXerV6iW/OhBFKEO17WtwIZe1ojS1rrlLr4PEO8O7alGKulmhiy1f1KI\nBHq1xrNpEJmZ1ymFJjR0Q3buCrQ45vJfu+KI7/LH+XootrDY7FG1e/tCUCLI\n4pF+Rtm4DzENrDdNgXf48arwx87hqo5S/v5myACgSe9p43edLd4s4Dpm2xS9\nWtOaHNLXxq3B3spUuF9yPkNDuh5UAlJ6LCX9/AhGakcry2Yla7nxPZG9z7XM\nAK7C8aMXYdLUJMJS3iHeHBOo4AOvdJmO0esC4hO/FcJjB4Ge0bw1H5v6fO+o\nTl+9\r\n=RRen\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICx8jqE4rkR3WS5eTkmV02Puuj/ORFg0u0WZzzOtyLuRAiEAyLhBkAL8Iub0WJKnLx6oTstmPeg3JmafOEjaHuQEirA="}]},"maintainers":[{"name":"graingert","email":"tagrain@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/django-js-reverse_0.0.1-alpha_1536678800369_0.9209057356242354"},"_hasShrinkwrap":false},"0.10.1-a.0":{"author":{"name":"Bernhard Janetzki"},"bugs":{"url":"https://github.com/ierror/django-js-reverse/issues"},"description":"JavaScript url handling for Django that doesn't hurt.","homepage":"https://github.com/ierror/django-js-reverse#readme","keywords":["django","js","reverse","url"],"license":"MIT","main":"index.js","name":"django-js-reverse","repository":{"type":"git","url":"git://github.com/ierror/django-js-reverse.git"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"version":"0.10.1-a.0","contributors":[{"name":"Maintainers"},{"name":"-----------"},{"name":"* [Bernhard Janetzki]","url":"https://github.com/ierror"},{"name":"* [Thomas Grainger]","url":"https://github.com/graingert"},{"name":"Contributors"},{"name":"------------"},{"name":"* [Kuntelin]","url":"https://github.com/kuntelin"},{"name":"* [metalpriest]","url":"https://github.com/metalpriest"},{"name":"* [emcsween]","url":"https://github.com/emcsween"},{"name":"* [hyperair]","url":"https://github.com/hyperair"},{"name":"* [Andertaker]","url":"https://github.com/Andertaker"},{"name":"* [bulv1ne]","url":"https://github.com/bulv1ne"},{"name":"* [logston]","url":"https://github.com/logston"},{"name":"* [aumo]","url":"https://github.com/aumo"},{"name":"* [defrex]","url":"https://github.com/defrex"},{"name":"* [michael-borisov]","url":"https://github.com/michael-borisov"},{"name":"* [chripede]","url":"https://github.com/chripede"},{"name":"* [mjnaderi]","url":"https://github.com/mjnaderi"},{"name":"* [BrnoPCmaniak]","url":"https://github.com/BrnoPCmaniak"},{"name":"* [razh]","url":"https://github.com/razh"},{"name":"* [ghedsouza]","url":"https://github.com/ghedsouza"},{"name":"* [karamanolev]","url":"https://github.com/karamanolev"},{"name":"* [wlonk]","url":"https://github.com/wlonk>"},{"name":"* [kavdev]","url":"https://github.com/kavdev"},{"name":"* [graingert]","url":"https://github.com/graingert"},{"name":"* [LuukOost]","url":"https://github.com/LuukOost"}],"gitHead":"a2ca3c18550b84d3e04e60d1d75c410a9bb542de","_id":"django-js-reverse@0.10.1-a.0","_nodeVersion":"10.16.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-t0lHG4LMjkpXBtRL6oQwBX1S5aygZgddQ4IEhTX9icRvRcGv2sx5zyrf1sKj6e8xtO7boibzWI94bSphoG6llw==","shasum":"ff915561930d3292c7e33c8b4d6f10ae8cecc8a0","tarball":"https://registry.npmjs.org/django-js-reverse/-/django-js-reverse-0.10.1-a.0.tgz","fileCount":6,"unpackedSize":23890,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdRBoGCRA9TVsSAnZWagAAmNcQAI55PaKFGqRnKs6bU/me\nfl1nq0uHDvj7c/JefPIEfcPi1dm9cxoM4lxdLyc7Wn3cR6MELUbLaOW0crtr\nkhS8OpxeerLdIajKpKWf0SC0E2bAHBtjXHgIb+heJOhYbYyq9WZ96W9qwEPc\nbq25DjglDWdIkjDzut6xFDdambadQOKtZe9AyrsdiwkardI1mb3xMF1FQopt\njzYBi+/3UBDlJKDoz+UurjhcGyYT89zN/0MSspGZk9aF7A1iYDxx5AWVbipJ\nqZ/mxaQFj+cpa57PATsNFv/vmzYyHqg+xfWqthTF2fLgF30zDqk4etZVYazW\nFabjfmSAmcw4IqZ9pOl7213YF6wVXL/WIlt62XO4fiPXFZS+LEEPxTTj572M\nN8Vz+CdaWJZuih8VSO7Qg8YAjXXFSgHpJt6veVywuDK6l+dgjFrY4Fb4PaLG\nJ7y30nlzsKoiiZMb+6DwkUvW6xZYb+BYyHBhB44HDtXD2yEuyfXOH7wFlM94\n+6NPCoSuWAEjnhg2Vg8G6pIvzr3TI91v5yImMQs3+MBqs7ELhwicLUtcqlEk\n5Y6iI/diq9++4gr7ZjUYesIwelbexAqbLHLdhagQ0qpox2SIHNYex5nGGaXh\nVkcOC44Sy1qPDkoBZ0+itbwcfI9rAJgWN41BBDaqugYBKFVM4z7G/UaPGL1Y\nAFMb\r\n=AYlV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTIgbtdjRTI5OjbDzA4jQjAXtrr+R9Pl/yMLRvnpawUgIgFPCNpieGSFTVtfTndt4X6hpevMV0DtQVquyoHnQImfA="}]},"maintainers":[{"email":"django-js-reverse@graingert.co.uk","name":"django-js-reverse"},{"email":"tagrain@gmail.com","name":"graingert"}],"_npmUser":{"name":"django-js-reverse","email":"django-js-reverse@graingert.co.uk"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/django-js-reverse_0.10.1-a.0_1564744198197_0.3268670208049034"},"_hasShrinkwrap":false}},"time":{"created":"2018-09-07T18:32:46.295Z","0.0.0":"2018-09-07T18:32:46.461Z","modified":"2022-04-28T23:10:35.680Z","0.0.1-alpha":"2018-09-11T15:13:20.498Z","0.10.1-a.0":"2019-08-02T11:09:58.373Z"},"maintainers":[{"email":"django-js-reverse@graingert.co.uk","name":"django-js-reverse"},{"email":"tagrain@gmail.com","name":"graingert"}],"description":"JavaScript url handling for Django that doesn't hurt.","homepage":"https://github.com/ierror/django-js-reverse#readme","keywords":["django","js","reverse","url"],"repository":{"type":"git","url":"git://github.com/ierror/django-js-reverse.git"},"contributors":[{"name":"Maintainers"},{"name":"-----------"},{"name":"* [Bernhard Janetzki]","url":"https://github.com/ierror"},{"name":"* [Thomas Grainger]","url":"https://github.com/graingert"},{"name":"Contributors"},{"name":"------------"},{"name":"* [Kuntelin]","url":"https://github.com/kuntelin"},{"name":"* [metalpriest]","url":"https://github.com/metalpriest"},{"name":"* [emcsween]","url":"https://github.com/emcsween"},{"name":"* [hyperair]","url":"https://github.com/hyperair"},{"name":"* [Andertaker]","url":"https://github.com/Andertaker"},{"name":"* [bulv1ne]","url":"https://github.com/bulv1ne"},{"name":"* [logston]","url":"https://github.com/logston"},{"name":"* [aumo]","url":"https://github.com/aumo"},{"name":"* [defrex]","url":"https://github.com/defrex"},{"name":"* [michael-borisov]","url":"https://github.com/michael-borisov"},{"name":"* [chripede]","url":"https://github.com/chripede"},{"name":"* [mjnaderi]","url":"https://github.com/mjnaderi"},{"name":"* [BrnoPCmaniak]","url":"https://github.com/BrnoPCmaniak"},{"name":"* [razh]","url":"https://github.com/razh"},{"name":"* [ghedsouza]","url":"https://github.com/ghedsouza"},{"name":"* [karamanolev]","url":"https://github.com/karamanolev"},{"name":"* [wlonk]","url":"https://github.com/wlonk>"},{"name":"* [kavdev]","url":"https://github.com/kavdev"},{"name":"* [graingert]","url":"https://github.com/graingert"},{"name":"* [LuukOost]","url":"https://github.com/LuukOost"}],"author":{"name":"Bernhard Janetzki"},"bugs":{"url":"https://github.com/ierror/django-js-reverse/issues"},"license":"MIT","readme":"=================\nDjango JS Reverse\n=================\n\n.. image:: https://img.shields.io/pypi/v/django-js-reverse.svg\n   :target: https://pypi.python.org/pypi/django-js-reverse/\n\n.. image:: https://img.shields.io/travis/ierror/django-js-reverse/master.svg\n   :target: https://travis-ci.org/ierror/django-js-reverse\n\n.. image:: https://img.shields.io/coveralls/ierror/django-js-reverse/master.svg\n   :alt: Coverage Status\n   :target: https://coveralls.io/r/ierror/django-js-reverse?branch=master\n\n.. image:: https://img.shields.io/github/license/ierror/django-js-reverse.svg\n    :target: https://raw.githubusercontent.com/ierror/django-js-reverse/master/LICENSE\n\n.. image:: https://img.shields.io/pypi/wheel/django-js-reverse.svg\n\n\n**Javascript url handling for Django that doesn’t hurt.**\n\n\nOverview\n--------\n\nDjango JS Reverse is a small django app that makes url handling of\n`named urls <https://docs.djangoproject.com/en/dev/topics/http/urls/#naming-url-patterns>`__ in javascript easy and non-annoying..\n\nFor example you can retrieve a named url:\n\nurls.py:\n\n::\n\n    url(r'^/betterliving/(?P<category_slug>[-\\w]+)/(?P<entry_pk>\\d+)/$', 'get_house', name='betterliving_get_house'),\n\nin javascript like:\n\n::\n\n    Urls.betterliving_get_house('house', 12)\n\nResult:\n\n::\n\n    /betterliving/house/12/\n\n\n\nChangelog\n_________\n\n0.9.0\n    New: Support for Python 3.7\n\n    New: Support for Django 2.2\n\n    New: Unit Tests Script prefix with no slash, changed URL Conf`#72 <https://github.com/ierror/django-js-reverse/issues/72>`__\n    Thank you `graingert <https://github.com/graingert>`__\n\n    Fix: \"ROOT_URLCONF not taken into account\" `#73 <https://github.com/ierror/django-js-reverse/issues/73>`__ `#74 <https://github.com/ierror/django-js-reverse/issues/74>`__\n    Thank you `LuukOost <https://github.com/LuukOost>`__ and `graingert <https://github.com/graingert>`__\n\n    Refactoring: \"move template logic to view\" `#64 <https://github.com/ierror/django-js-reverse/issues/64>`__\n    Thank you `graingert <https://github.com/graingert>`__\n\n    Fix: \"Now using LooseVersion instead of StrictVersion to avoid issues with rc releases\" `#67 <https://github.com/ierror/django-js-reverse/issues/64>`__\n    Thank you `kavdev <https://github.com/kavdev>`__\n\n0.8.2\n    Fix: A bug fix in Django 2.0.6 has broken django-js-reverse `#65 <https://github.com/ierror/django-js-reverse/issues/65>`__\n    Thank you `kavdev <https://github.com/kavdev>`__\n\n0.8.1\n    Fix: The tests folder of the `#53 <https://github.com/ierror/django-js-reverse/issues/53>`__ was still present in the build. => Added cleanup to the release make command.\n\n0.8.0\n    New: Support for Django 2.0: `#58 <https://github.com/ierror/django-js-reverse/issues/58>`__\n    Thank you `wlonk <https://github.com/wlonk>`__\n\n    Fix: `#53 <https://github.com/ierror/django-js-reverse/issues/53>`__ - Don't install the tests folder as a separate folder.  Moved inside the django_js_reverse namespace.\n\n\n`Full changelog <https://raw.githubusercontent.com/ierror/django-js-reverse/master/CHANGELOG>`__\n\n\nRequirements\n------------\n\n+----------------+------------------------------------------+\n| Python version | Django versions                          |\n+================+==========================================+\n| 3.7            | 2.2, 2.1, 2.0, 1.11, 1.10, 1.9, 1.8      |\n+----------------+------------------------------------------+\n| 3.6            | 2.2, 2.1, 2.0, 1.11, 1.10, 1.9, 1.8      |\n+----------------+------------------------------------------+\n| 3.5            | 2.2, 2.1, 2.0, 1.11, 1.10, 1.9, 1.8      |\n+----------------+------------------------------------------+\n| 3.4            | 2.0, 1.11, 1.10, 1.9, 1.8, 1.7, 1.6, 1.5 |\n+----------------+------------------------------------------+\n| 2.7            | 1.11, 1.10, 1.9, 1.8, 1.7, 1.6, 1.5      |\n+----------------+------------------------------------------+\n\n\nInstallation\n------------\n\nInstall using ``pip`` …\n\n::\n\n    pip install django-js-reverse\n\n… or clone the project from github.\n\n::\n\n    git clone https://github.com/ierror/django-js-reverse.git\n\nAdd ``'django_js_reverse'`` to your ``INSTALLED_APPS`` setting.\n\n::\n\n    INSTALLED_APPS = (\n        ...\n        'django_js_reverse',\n    )\n\n\nUsage with webpack\n------------------\n\nInstall using ``npm``\n\n::\n\n    npm install --save django-js-reverse\n\n\nInclude none-cached view …\n\n::\n\n    urlpatterns = patterns('',\n        url(r'^jsreverse.json$', 'django_js_reverse.views.urls_json', name='js_reverse'),\n    )\n\n… or a cached one that delivers the urls JSON\n\n::\n\n    from django_js_reverse import views\n    urlpatterns = patterns('',\n        url(r'^jsreverse.json$', cache_page(3600)(views.urls_json), name='js_reverse'),\n    )\n\nInclude JavaScript in your bundle:\n\n::\n\n    // utils/djangoReverse.mjs\n    import _ from 'lodash/fp';\n    import djangoJsReverse from 'django-js-reverse';\n\n    export default _.once(\n      async () => {\n        const res = await fetch('/jsreverse.json');\n        const data = await res.json():\n        return djangoJsReverse(data);\n      }\n    )\n\n::\n\n    // somePlace.mjs\n    import djangoReverse from './utils/djangoReverse';\n\n    (async () => {\n      const urls = await djangoReverse();\n      const url = urls.someViewName('some-arg');\n      ...\n    })();\n\n\nUsage as static file\n--------------------\n\nFirst generate static file by\n\n::\n\n    ./manage.py collectstatic_js_reverse\n\nIf you change some urls or add an app and want to update the reverse.js file,\nrun the command again.\n\nAfter this add the file to your template\n\n::\n\n    <script src=\"{% static 'django_js_reverse/js/reverse.js' %}\"></script>\n\n\nUsage with views\n----------------\n\nInclude none-cached view …\n\n::\n\n    urlpatterns = patterns('',\n        url(r'^jsreverse/$', 'django_js_reverse.views.urls_js', name='js_reverse'),\n    )\n\n… or a cached one that delivers the urls javascript\n\n::\n\n    from django_js_reverse.views import urls_js\n    urlpatterns = patterns('',\n        url(r'^jsreverse/$', cache_page(3600)(urls_js), name='js_reverse'),\n    )\n\nInclude javascript in your template\n\n::\n\n    <script src=\"{% url js_reverse %}\" type=\"text/javascript\"></script>\n\nor, if you are using Django > 1.5\n\n::\n\n    <script src=\"{% url 'js_reverse' %}\" type=\"text/javascript\"></script>\n\n\nUsage as template tag\n_____________________\n\nYou can place the js_reverse JavaScript inline into your templates,\nhowever use of inline JavaScript is not recommended, because it\nwill make it impossible to deploy a secure Content Security Policy.\nSee `django-csp <https://django-csp.readthedocs.io/>`__\n\n::\n\n    {% load js_reverse %}\n\n    <script type=\"text/javascript\" charset=\"utf-8\">\n        {% js_reverse_inline %}\n    </script>\n\n\nUse the urls in javascript\n--------------------------\n\nIf your url names are valid javascript identifiers ([$A-Z\\_][-Z\\_$]\\*)i\nyou can access them by the Dot notation:\n\n::\n\n    Urls.betterliving_get_house('house', 12)\n\nIf the named url contains invalid identifiers use the Square bracket\nnotation instead:\n\n::\n\n    Urls['betterliving-get-house']('house', 12)\n    Urls['namespace:betterliving-get-house']('house', 12)\n\nYou can also pass javascript objects to match keyword aguments like the\nexamples bellow:\n\n::\n\n    Urls['betterliving-get-house']({ category_slug: 'house', entry_pk: 12 })\n    Urls['namespace:betterliving-get-house']({ category_slug: 'house', entry_pk: 12 })\n\nOptions\n-------\n\nOptionally, you can overwrite the default javascript variable ‘Urls’ used\nto access the named urls by django setting\n\n::\n\n    JS_REVERSE_JS_VAR_NAME = 'Urls'\n\nOptionally, you can change the name of the global object the javascript variable\nused to access the named urls is attached to. Default is :code:`this`\n\n::\n\n    JS_REVERSE_JS_GLOBAL_OBJECT_NAME = 'window'\n\n\nOptionally, you can disable the minfication of the generated javascript file\nby django setting\n\n::\n\n    JS_REVERSE_JS_MINIFY = False\n\n\nBy default all namespaces are included\n\n::\n\n    JS_REVERSE_EXCLUDE_NAMESPACES = []\n\nTo exclude any namespaces from the generated javascript file, add them to the `JS_REVERSE_EXCLUDE_NAMESPACES` setting\n\n::\n\n    JS_REVERSE_EXCLUDE_NAMESPACES = ['admin', 'djdt', ...]\n\nIf you want to include only specific namespaces add them to the `JS_REVERSE_INCLUDE_ONLY_NAMESPACES` setting\ntips:\n* Use \"\" (empty string) for urls without namespace\n* Use \"foo\\0\" to include urls just from \"foo\" namaspace and not from any subnamespaces (e.g. \"foo:bar\")\n\n::\n\n    JS_REVERSE_INCLUDE_ONLY_NAMESPACES = ['poll', 'calendar', ...]\n\nIf you run your application under a subpath, the collectstatic_js_reverse needs to take care of this.\nDefine the prefix in your django settings:\n\n::\n\n   JS_REVERSE_SCRIPT_PREFIX = '/myprefix/'\n\nBy default collectstatic_js_reverse writes its output (reverse.js) to your project's STATIC_ROOT.\nYou can change the output path:\n\n::\n\n    JS_REVERSE_OUTPUT_PATH = 'some_path'\n\n\nRunning the test suite\n----------------------\n\n::\n\n    tox\n\nLicense\n-------\n\n`MIT <https://raw.github.com/ierror/django-js-reverse/master/LICENSE>`__\n\n\nContact\n-------\n\n`@i_error <https://twitter.com/i_error>`__\n\n--------------\n\nEnjoy!\n","readmeFilename":"README.rst"}