{ "info": { "author": "impak Finance", "author_email": "tech@impakfinance.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "django-js-urls\n##############\n\n**Django-js-url** is a lightweight Django application allowing to easily get absolute path\nreferences matching given URL names and optional parameters on the client side - just like\n`reverse `_ does, but in a\nJavascript fashion.\n\n.. contents:: Table of Contents\n :local:\n\nMain requirements\n=================\n\nPython 3.4+, Django 1.11+.\n\nInstallation\n============\n\nTo install Django-js-urls, please use pip_ (or pipenv_) as follows:\n\n.. code-block:: shell\n\n $ pip install django-js-urls\n\nOnce installed you just need to add ``js_urls`` to ``INSTALLED_APPS`` in your project's settings\nmodule:\n\n.. code-block:: python\n\n INSTALLED_APPS = (\n # other apps\n 'js_urls',\n )\n\nURLs that are included in the Javascript helper tool are configured using a single ``JS_URL``\nsetting. This setting can embed URL namespaces or specific URL names that should be included in the\ngenerated Javascript file. For example:\n\n.. code-block:: python\n\n JS_URLS = (\n 'admin',\n 'blog:article_list',\n 'blog:article_detail',\n )\n\n**Important:** only URLs defined in this setting will be included in the generated Javascript file.\nYou don't want to expose *all* the URLs of your Django project in a Javascript file.\n\nThen you can include the view responsible for generating the Javascript file in your URLs root\nmodule:\n\n.. code-block:: python\n\n from js_urls.views import JsUrlsView\n\n urlpatterns = [\n # other urls\n url(r'^js-urls/$', JsUrlsView.as_view(), name='js_urls'),\n ]\n\nAnd finally you can include the Javascript script in your base template as follows:\n\n.. code-block:: html\n\n \n\nUsage\n=====\n\nURLs included in the generated Javascript file can be used in your scripts by using the\n``window.reverse`` function. Here are some example:\n\n.. code-block:: javascript\n\n const url1 = window.reverse('home');\n const url2 = window.reverse('blog:article_list');\n const url3 = window.reverse('blog:article_detail', articleId);\n const url4 = window.reverse('blog:article_detail', [articleId, ]);\n const url5 = window.reverse('blog:article_detail', { pk: articleId });\n\nAuthors\n=======\n\nimpak Finance .\n\nLicense\n=======\n\nMIT. See ``LICENSE`` for more details.\n\n.. _pip: https://github.com/pypa/pip\n.. _pipenv: https://github.com/pypa/pipenv\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/impak-finance/django-js-urls", "keywords": "django javascript js url urls helper", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-js-urls", "package_url": "https://pypi.org/project/django-js-urls/", "platform": "", "project_url": "https://pypi.org/project/django-js-urls/", "project_urls": { "Homepage": "https://github.com/impak-finance/django-js-urls" }, "release_url": "https://pypi.org/project/django-js-urls/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "A convenient helper to use Django URLs in Javascript.", "version": "0.1.1" }, "last_serial": 4297350, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "3838a2fd8dbcec7b2fac43fcd655e45e", "sha256": "7ced82646919f25d9c6cd4b5c189998d9b5483f1567bcd51cf5776e8961fbf5b" }, "downloads": -1, "filename": "django_js_urls-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "3838a2fd8dbcec7b2fac43fcd655e45e", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 8976, "upload_time": "2018-08-06T15:36:25", "url": "https://files.pythonhosted.org/packages/90/a2/e6d4fe633461576c220b40da03b07e0801c7c4ce05c6d3f129d8205b748b/django_js_urls-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3a05268887997bce5ff7645a61d06c9f", "sha256": "c88a2438c0252c3b0e6f129d3df4f6e07e60460ff058ba9cd1529d52fca91dc1" }, "downloads": -1, "filename": "django-js-urls-0.1.0.tar.gz", "has_sig": false, "md5_digest": "3a05268887997bce5ff7645a61d06c9f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6945, "upload_time": "2018-08-06T15:36:24", "url": "https://files.pythonhosted.org/packages/7c/fe/796fb0d399cc85da46ed92614fde36ff736298818b535e1c4f24d07c6610/django-js-urls-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "66b9d56897e3212a852c840b59cb7e40", "sha256": "c51660f5f7ab22037e91ce161e4e74405bc2ee714573ce762899ef73c5d818a8" }, "downloads": -1, "filename": "django_js_urls-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "66b9d56897e3212a852c840b59cb7e40", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 8977, "upload_time": "2018-09-21T18:31:50", "url": "https://files.pythonhosted.org/packages/53/42/4fedb83272adf43d1e4a5aba807adc366634c6914abed577b4f22e262cb9/django_js_urls-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "95a2a46715b7538a8ca40b49448c84ec", "sha256": "9e578a1dae530968ea1c3d609a9177c7fe7bbc2774e5e61dcb2da4b311527cce" }, "downloads": -1, "filename": "django-js-urls-0.1.1.tar.gz", "has_sig": false, "md5_digest": "95a2a46715b7538a8ca40b49448c84ec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6950, "upload_time": "2018-09-21T18:31:49", "url": "https://files.pythonhosted.org/packages/a7/77/b466e0974cccdc620c3e501e92b0e6644cb4961c70cd8e006aa95eed36aa/django-js-urls-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "66b9d56897e3212a852c840b59cb7e40", "sha256": "c51660f5f7ab22037e91ce161e4e74405bc2ee714573ce762899ef73c5d818a8" }, "downloads": -1, "filename": "django_js_urls-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "66b9d56897e3212a852c840b59cb7e40", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 8977, "upload_time": "2018-09-21T18:31:50", "url": "https://files.pythonhosted.org/packages/53/42/4fedb83272adf43d1e4a5aba807adc366634c6914abed577b4f22e262cb9/django_js_urls-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "95a2a46715b7538a8ca40b49448c84ec", "sha256": "9e578a1dae530968ea1c3d609a9177c7fe7bbc2774e5e61dcb2da4b311527cce" }, "downloads": -1, "filename": "django-js-urls-0.1.1.tar.gz", "has_sig": false, "md5_digest": "95a2a46715b7538a8ca40b49448c84ec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6950, "upload_time": "2018-09-21T18:31:49", "url": "https://files.pythonhosted.org/packages/a7/77/b466e0974cccdc620c3e501e92b0e6644cb4961c70cd8e006aa95eed36aa/django-js-urls-0.1.1.tar.gz" } ] }