{ "info": { "author": "Imbolc", "author_email": "imbolc@imbolc.name", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: ISC License (ISCL)", "Programming Language :: Python :: 3" ], "description": "A flask-style `route` decorator for django views\n================================================\n\n> Simple things should be simple, complex things should be possible (c)Alan Kay\n\nThere is some contradiction between decoupling and DRY principles\nin django urls. Why not use flasky `@route` decorator to fix this issue?\n\nInstall\n-------\n pip install django-route-decorator\n\nIt's compatible with django >= 2.0 only,\nbecause it uses new `urls.path` syntax.\n\n\nSimple things should be simple\n------------------------------\nJust decorate your views with an instance of `Route`:\n\n from route_decorator import Route\n\n route = Route()\n\n @route\n def foo_view(request):\n ...\n\n @route\n def bar_view(request):\n ...\n\n\nAnd don't forget to add the routes into your `urls.py`:\n\n from . import views\n\n urlpatterns += views.route.patterns\n\n\nNow you have your views binded to `/foo-view` and `/bar-view` respectively.\n\nYou can also get map urlname -> url with `route.names` and pass them to\nfrontend maybe. In our case it would be:\n\n {\n 'foo_view': '/foo-view',\n 'bar_view': '/bar-view'\n }\n\n\nComplex things should be possible\n---------------------------------\nYou can pass `url_prefix` and `name_prefix` to route:\n\n route = Router('/api', 'api:')\n\nAnd also use `path` and `name` in a decorator:\n\n @route('/baz', 'baz-name')\n def baz_view(request):\n ...\n\nSo it would be bind to `/api/baz` with name `api:baz-name`.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/imbolc/django-route-decorator", "keywords": "", "license": "ISC", "maintainer": "", "maintainer_email": "", "name": "django-route-decorator", "package_url": "https://pypi.org/project/django-route-decorator/", "platform": "", "project_url": "https://pypi.org/project/django-route-decorator/", "project_urls": { "Homepage": "https://github.com/imbolc/django-route-decorator" }, "release_url": "https://pypi.org/project/django-route-decorator/0.0.3/", "requires_dist": null, "requires_python": "", "summary": "A flask-style `route` decorator for django views", "version": "0.0.3" }, "last_serial": 3976376, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "6e4e61fcf3d984a8dc749e9a9038c8b1", "sha256": "a0e2e10f3e9697886e0890b2dd90daecb5274761e6cd63ef0d1e548a71eb550e" }, "downloads": -1, "filename": "django-route-decorator-0.0.1.tar.gz", "has_sig": false, "md5_digest": "6e4e61fcf3d984a8dc749e9a9038c8b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1881, "upload_time": "2018-06-19T05:59:27", "url": "https://files.pythonhosted.org/packages/9d/2c/4e178a905b8717b12b25d079ba58e9fead7f27879563a52f42c5b185a026/django-route-decorator-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "de56401674505613808af6efc3bbaffa", "sha256": "aa10b95a0c512f479050164b69911ce45420f02c1b9a8d4e05e4f42d261f2983" }, "downloads": -1, "filename": "django-route-decorator-0.0.2.tar.gz", "has_sig": false, "md5_digest": "de56401674505613808af6efc3bbaffa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1872, "upload_time": "2018-06-19T07:14:24", "url": "https://files.pythonhosted.org/packages/ee/9b/63b78b0b67a1bde0b2f7b5b206a96d6b71c0882952d7af4f2b2a6c171b2b/django-route-decorator-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "4e7c2ae01931808e55de674d52249196", "sha256": "b0dedf170a0a0d7126171dcbb62804412b38c03fa3ae94087d2ae5d1e0e2a302" }, "downloads": -1, "filename": "django-route-decorator-0.0.3.tar.gz", "has_sig": false, "md5_digest": "4e7c2ae01931808e55de674d52249196", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2200, "upload_time": "2018-06-19T07:21:54", "url": "https://files.pythonhosted.org/packages/a8/2f/d92992e26d1233bc7eebe0efdc8b8cd275d95f7d9f3b9406d76682291f58/django-route-decorator-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4e7c2ae01931808e55de674d52249196", "sha256": "b0dedf170a0a0d7126171dcbb62804412b38c03fa3ae94087d2ae5d1e0e2a302" }, "downloads": -1, "filename": "django-route-decorator-0.0.3.tar.gz", "has_sig": false, "md5_digest": "4e7c2ae01931808e55de674d52249196", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2200, "upload_time": "2018-06-19T07:21:54", "url": "https://files.pythonhosted.org/packages/a8/2f/d92992e26d1233bc7eebe0efdc8b8cd275d95f7d9f3b9406d76682291f58/django-route-decorator-0.0.3.tar.gz" } ] }