{
"info": {
"author": "Dimitri Gnidash, Jiri Suchan",
"author_email": "dimitri.gnidash@gmail.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Software Development :: Libraries :: Python Modules"
],
"description": "==========================\ndutils - Django JS Utils\n==========================\n\ndutils is a small utility library that aims to provide JavaScript/Django developers with\na few utilities that will help the development of RIA on top of a\nDjango Backend.\n\nReversing Django Urls from Javascript\n-------------------------------------\nWhy is this useful\n******************\nOne of the pillars of Django is DRY principle and hardcoding your urls in Javascript is violating that principle.\n\nMoreover, building parametrized urls on the fly is error-prone and ugly.\n\nWhat is included\n****************\nA snippet of Javascript implementation of Django reverse function that can be found in dutils.js\n\nA management command js_urls to generate a list of all of your Django urls\n\nInstallation\n************\n1. Add django_js_utils to your python path and add the django_js_utils application to your INSTALLED_APPS (if you want\nto use the management command)\n\n2. Set the path and file name to generate urls to inside your django settings file.\nExample::\n URLS_JS_GENERATED_FILE='static/js/dutils.conf.urls.js'\n\n3. Set the url namespaces or names to resolve - only names specified in this list will be resolved to the file\nExample::\n URLS_JS_TO_EXPOSE = ['admin', 'another_namespace', 'a_url_name',]\n\n4. Add entries into your base.html template (or where ever you need) to include the dutils.js file, along with the dutils.conf.urls.js patterns file. If you're using Django's staticfiles app, you'll use something\nlike::\n \n \n\n\nUsage\n*****\n1. Generate a list of all available urls in the special\nformat::\n >>> python manage.py js_urls\n\nTo keep the list of urls up-to-date, it is recommended to include this command as part of the build process.\n\n2. If you're using Django's staticfiles app, issue the collectstatic command to include dutils.js and the urls list you generated in step 1 in your static\ndirectory::\n >>> python manage.py collectstatic\n\n3. On the web page, reverse url as\nsuch::\n >>> $.post(dutils.urls.resolve('time_edit', { project_id: 1, time_id: 2 }), ...\n\nFor more usage, see example.html\n\n\nTO-DO\n------\n1. Handle the unnamed Django urls that result in <> in urls.js file, but are not handled in Javascript resolver.\n\n2. Write unit tests\n\n3. Promote the code",
"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/SanomaCZ/django-js-utils",
"keywords": null,
"license": "BSD",
"maintainer": null,
"maintainer_email": null,
"name": "django-js-utils-ng",
"package_url": "https://pypi.org/project/django-js-utils-ng/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/django-js-utils-ng/",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "https://github.com/SanomaCZ/django-js-utils"
},
"release_url": "https://pypi.org/project/django-js-utils-ng/0.5.futu/",
"requires_dist": null,
"requires_python": null,
"summary": "Django URL Exposure to Javascript",
"version": "0.5.futu"
},
"last_serial": 1135437,
"releases": {
"0.5.futu": [
{
"comment_text": "",
"digests": {
"md5": "7dc9ec14800649aa992e77910a2801c3",
"sha256": "0796e959bd6c40cbfdd5d96643c68539845803bedf3bea3e6481d1cbe6376054"
},
"downloads": -1,
"filename": "django-js-utils-ng-0.5.futu.tar.gz",
"has_sig": false,
"md5_digest": "7dc9ec14800649aa992e77910a2801c3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5294,
"upload_time": "2014-06-24T07:36:59",
"url": "https://files.pythonhosted.org/packages/e6/dd/ad3a7f5a209a23b1b2242b98bfa57cb5873f4643e8eed94f67e76a0f6a3a/django-js-utils-ng-0.5.futu.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "7dc9ec14800649aa992e77910a2801c3",
"sha256": "0796e959bd6c40cbfdd5d96643c68539845803bedf3bea3e6481d1cbe6376054"
},
"downloads": -1,
"filename": "django-js-utils-ng-0.5.futu.tar.gz",
"has_sig": false,
"md5_digest": "7dc9ec14800649aa992e77910a2801c3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5294,
"upload_time": "2014-06-24T07:36:59",
"url": "https://files.pythonhosted.org/packages/e6/dd/ad3a7f5a209a23b1b2242b98bfa57cb5873f4643e8eed94f67e76a0f6a3a/django-js-utils-ng-0.5.futu.tar.gz"
}
]
}