{ "info": { "author": "Laurent Peuch", "author_email": "cortex@worlddomination.be", "bugtrack_url": null, "classifiers": [], "description": "Usage\n=====\n\n.. code:: python\n\n from django.conf.urls import patterns, url\n from django_view_dispatch import dispatch, dispatch_strict\n\n from . import views\n\n\n urlpatterns = patterns('',\n url(r'^some_url/$', dispatch(get=views.my_view, post=views.my_view_for_post), name='events_json'),\n\n # you can get any keyword argument you want to specify any http verb\n url(r'^some_url/$', dispatch(get=views.my_view, put=views.create, foo=views.another_view, bar=views.baz), name='events_json'),\n\n # by default, if a request has an HTTP verb that hasn't been specified in\n # the dispatch() function, it will be redirected to the GET view if present\n url(r'^some_url/$', dispatch(get=views.will_get_everything_thats_not_put, put=views.stuff), name='events_json'),\n\n # you can change this behavior this way\n url(r'^some_url/$', dispatch(get=views.stuff, put=views.will_get_everything_thats_not_get, default=\"put\"), name='events_json'),\n\n # if \"default\" is set to None, this behavior is disabled and and\n # HttpResponseNotAllowed will be returned\n url(r'^input/$', dispatch(post=views.my_view_for_post, default=None), name='events_json'), # behave like @require_POST\n\n # a more explicit way to do that is provided with \"dispatch_strict\" which behave exactly like dispatch with default set to None\n url(r'^input/$', dispatch_strict(post=views.my_view_for_post), name='events_json'),\n )\n\nInstallation\n============\n\n::\n\n pip install django_view_dispatch\n\nWhy\n===\n\nSomething that you learn as you progress in programming is that\nconditional are \"bad\" (as in \"should be avoided\") because they `increase\nthe complexity of your\ncode `__ and are a\npotential source of bugs.\n\nFor example, mixing POST and GET handling in the same view can be a good\nterrain for bug and for a more complex code while spliting it gives a\n`KISS `__ situation where\nyou have two views that do only one thing and do it well.\n\nDjango doesn't provide an easy nor standard way to do this so this\nlibrary is trying to address that.\n\nCan I use string like in the url function?\n==========================================\n\nNo, since django 1.8, using string to target views in patterns `is\ndepreciated `__,\ntherefor there is no point in supporting this feature.\n\nAlso, to be honest, I have not idea on how to do that and haven't really\nmade any research about it. That would also make the code way more\ncomplex.\n\nRunning tests\n=============\n\n::\n\n pip install pytest\n py.test test.py\n\nLicence\n=======\n\nBSD.", "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/Psycojoker/django_view_dispatch", "keywords": "django", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django_view_dispatch", "package_url": "https://pypi.org/project/django_view_dispatch/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django_view_dispatch/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/Psycojoker/django_view_dispatch" }, "release_url": "https://pypi.org/project/django_view_dispatch/0.1/", "requires_dist": null, "requires_python": null, "summary": "Django utility to dispatch views based on request method", "version": "0.1" }, "last_serial": 1497655, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "5c59d83e0409ddc985e1d9a1dbe123e7", "sha256": "364201152621961a132e08a07ec2e842dea53c94ae99978ce8e745f63a55814f" }, "downloads": -1, "filename": "django_view_dispatch-0.1-py2.7.egg", "has_sig": false, "md5_digest": "5c59d83e0409ddc985e1d9a1dbe123e7", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 2796, "upload_time": "2015-04-09T15:21:49", "url": "https://files.pythonhosted.org/packages/9f/27/44e367fa0440f55955d998c090719cd9c4d3a9bbd2646d26fd024f6a3c32/django_view_dispatch-0.1-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "f79b491ef5b3f68975f1cc2118c33ef2", "sha256": "57b54025af7746a14c3106be3f247f6ab7b41bd6f579a6c99c4c3d737bef749f" }, "downloads": -1, "filename": "django_view_dispatch-0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f79b491ef5b3f68975f1cc2118c33ef2", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 4914, "upload_time": "2015-04-09T15:21:46", "url": "https://files.pythonhosted.org/packages/46/e3/4ef095f2f1568d68af52001c1fb453d8b5d60f3cc9b2cf9942c40fceaa5c/django_view_dispatch-0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dac208e1c4d627f05943658419ace6a8", "sha256": "78be42e34a9912142efb0f82f0eb908d3c42f58da8a633b8a9fe9f177d6c5c09" }, "downloads": -1, "filename": "django_view_dispatch-0.1.tar.gz", "has_sig": false, "md5_digest": "dac208e1c4d627f05943658419ace6a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2606, "upload_time": "2015-04-09T15:21:42", "url": "https://files.pythonhosted.org/packages/21/0a/9c12d50959c0f1be58be64f5420bc68ddad5b61194defd2f8416676826b2/django_view_dispatch-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5c59d83e0409ddc985e1d9a1dbe123e7", "sha256": "364201152621961a132e08a07ec2e842dea53c94ae99978ce8e745f63a55814f" }, "downloads": -1, "filename": "django_view_dispatch-0.1-py2.7.egg", "has_sig": false, "md5_digest": "5c59d83e0409ddc985e1d9a1dbe123e7", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 2796, "upload_time": "2015-04-09T15:21:49", "url": "https://files.pythonhosted.org/packages/9f/27/44e367fa0440f55955d998c090719cd9c4d3a9bbd2646d26fd024f6a3c32/django_view_dispatch-0.1-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "f79b491ef5b3f68975f1cc2118c33ef2", "sha256": "57b54025af7746a14c3106be3f247f6ab7b41bd6f579a6c99c4c3d737bef749f" }, "downloads": -1, "filename": "django_view_dispatch-0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f79b491ef5b3f68975f1cc2118c33ef2", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 4914, "upload_time": "2015-04-09T15:21:46", "url": "https://files.pythonhosted.org/packages/46/e3/4ef095f2f1568d68af52001c1fb453d8b5d60f3cc9b2cf9942c40fceaa5c/django_view_dispatch-0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dac208e1c4d627f05943658419ace6a8", "sha256": "78be42e34a9912142efb0f82f0eb908d3c42f58da8a633b8a9fe9f177d6c5c09" }, "downloads": -1, "filename": "django_view_dispatch-0.1.tar.gz", "has_sig": false, "md5_digest": "dac208e1c4d627f05943658419ace6a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2606, "upload_time": "2015-04-09T15:21:42", "url": "https://files.pythonhosted.org/packages/21/0a/9c12d50959c0f1be58be64f5420bc68ddad5b61194defd2f8416676826b2/django_view_dispatch-0.1.tar.gz" } ] }