{ "info": { "author": "LocalMed", "author_email": "pete.browne@localmed.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Topic :: Internet :: WWW/HTTP" ], "description": "# Django Method Override\n\nDjango middleware that overrides the HTTP method through either a `_method` form param (Ruby on Rails style) or the X-HTTP-Method-Override header.\n\n## Installation\n\n1. Install via pip:\n\n ```bash\n pip install django-method-override\n ```\n\n2. Add the `MethodOverrideMiddleware` **after** Django's `CsrfViewMiddleware`:\n\n ```python\n MIDDLEWARE = (\n # ...\n 'django.middleware.csrf.CsrfViewMiddleware',\n 'method_override.middleware.MethodOverrideMiddleware',\n # ...\n )\n ```\n\n3. Add `method_override` to your `INSTALLED_APPS`:\n\n ```python\n INSTALLED_APPS = (\n # ...\n 'method_override',\n )\n ```\n\n## Usage\n\nUse the provided template tag in your form to add the desired form:\n\n```html+django\n{% load method_override %}\n
\n```\n\nNow, you may use `put` in you Class-based views. Django Method Override will even copy over the form data to `request.PUT`:\n\n```python\nclass PostView(View):\n def put(self, request):\n form = Form(request.PUT)\n # ...\n```\n\nThe X-HTTP-Method-Override header is also supported. So for the above view, this will work too:\n\n```javascript\n$.ajax({\n headers: { \"X-HTTP-Method-Override\": \"PUT\" },\n type: \"POST\",\n url: \"http://localhost:8000/posts/1/\"\n // ...\n});\n```\n\n## Configuration\n\nDjango Method Override can be customized from your Django `settings.py` file:\n\n### `METHOD_OVERRIDE_ALLOWED_HTTP_METHODS`\n\nA list of the allowed methods for overriding. Defaults to:\n\n```python\n['GET', 'HEAD', 'PUT', 'POST', 'DELETE', 'OPTIONS', 'PATCH']\n```\n\n### `METHOD_OVERRIDE_PARAM_KEY`\n\nThe form param key used to override the method. Defaults to `'_method'`.\n\n### `METHOD_OVERRIDE_HTTP_HEADER`\n\nThe HTTP header to check. Defaults to `'HTTP_X_HTTP_METHOD_OVERRIDE'`\n\n### `METHOD_OVERRIDE_INPUT_TEMPLATE`\n\nThe string tempalte used to render the input for the form param. It will based to kwargs, `name` and `value`. Defaults to:\n\n```python\n''\n```\n\n## Copyright\n\nCopyright (c) 2013 [LocalMed, Inc.](http://www.localmed.com/). See LICENSE for details.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.com/localmed/django-method-override", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-method-override", "package_url": "https://pypi.org/project/django-method-override/", "platform": "", "project_url": "https://pypi.org/project/django-method-override/", "project_urls": { "Homepage": "https://gitlab.com/localmed/django-method-override" }, "release_url": "https://pypi.org/project/django-method-override/1.0.3/", "requires_dist": [ "django (>=2.0)" ], "requires_python": "", "summary": "Django Middleware for HTTP Method Override Form Params & Header", "version": "1.0.3" }, "last_serial": 4266494, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "629f6332501f81d92a5d3b29f907cf04", "sha256": "4bba679eac11fad8a6a83449fe25e6f6c40633c035748618e10bc9d45b157c14" }, "downloads": -1, "filename": "django-method-override-0.1.0.tar.gz", "has_sig": false, "md5_digest": "629f6332501f81d92a5d3b29f907cf04", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4157, "upload_time": "2013-06-12T22:10:46", "url": "https://files.pythonhosted.org/packages/58/d1/1a6f916286362d116b3650660891711665004fa7264ec5477d60249ef253/django-method-override-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "834cb4b41be105216fdd73dc4a10e4f7", "sha256": "bd24aa2e9792d8cdf2cf3cb9886a160c8a0f583b612fe3789acf8f4136672c1e" }, "downloads": -1, "filename": "django-method-override-0.2.0.tar.gz", "has_sig": false, "md5_digest": "834cb4b41be105216fdd73dc4a10e4f7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4237, "upload_time": "2016-08-31T15:39:00", "url": "https://files.pythonhosted.org/packages/9c/eb/166768db3946f759a99d0aae3c89df713d56c1bf7a35261996ebfbd9938d/django-method-override-0.2.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "1c5aef494e6ae440cd15b8f00a7527bc", "sha256": "66220334a4d34f742957721b93a8e4181d97ff2a559b4e7adea865a8a72b5e50" }, "downloads": -1, "filename": "django-method-override-1.0.0.tar.gz", "has_sig": false, "md5_digest": "1c5aef494e6ae440cd15b8f00a7527bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3582, "upload_time": "2018-08-29T20:39:37", "url": "https://files.pythonhosted.org/packages/d9/ac/e8e9dc532162d9b170e90bd18929c9e6f81b9b54ea39757839053b15129e/django-method-override-1.0.0.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "dc35820944263ba54ad1b325d2687847", "sha256": "619e6c2295f9971262613e5afbb0fe9da9e3287f6cb2fd0b5c1a1295065a30d5" }, "downloads": -1, "filename": "django_method_override-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "dc35820944263ba54ad1b325d2687847", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4316, "upload_time": "2018-08-29T20:51:26", "url": "https://files.pythonhosted.org/packages/2a/1d/56962fe887f2edb3884941b95832968de2cae0783b68bbd919c83a544eba/django_method_override-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "14e56684b97f265aab677906ca5994e2", "sha256": "351236d61c84ec41c2d2749401dfff9bf238fd28584b59cc819b71e1eba391bc" }, "downloads": -1, "filename": "django-method-override-1.0.2.tar.gz", "has_sig": false, "md5_digest": "14e56684b97f265aab677906ca5994e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4005, "upload_time": "2018-08-29T20:51:27", "url": "https://files.pythonhosted.org/packages/cd/ef/0202d69e6fa62bc9e7d02d56b407fdf47005b143e3a76d92deb443fd189f/django-method-override-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "0c9c4652599617b58c7c2f93f61aa49a", "sha256": "3974b1382e21ed65f5abfaa60d949837b3c4e52872deddbad3260256d9d815b9" }, "downloads": -1, "filename": "django_method_override-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "0c9c4652599617b58c7c2f93f61aa49a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4346, "upload_time": "2018-09-12T21:09:21", "url": "https://files.pythonhosted.org/packages/d5/d1/a76820ded8c1a69b15200ef7af9ffd6408042d1d915b4db88b984956a81e/django_method_override-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c31b9184bb34a4fad38a179c92932627", "sha256": "3ff2791c8665932a1d15f4ec699422d5e06b49d5c0f2cd2ff32af9f7b87b4a70" }, "downloads": -1, "filename": "django-method-override-1.0.3.tar.gz", "has_sig": false, "md5_digest": "c31b9184bb34a4fad38a179c92932627", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4038, "upload_time": "2018-09-12T21:09:22", "url": "https://files.pythonhosted.org/packages/21/f8/8d41b023e2ab260532e3377c05b4a43d293f9eb862c62863680cf2054f45/django-method-override-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0c9c4652599617b58c7c2f93f61aa49a", "sha256": "3974b1382e21ed65f5abfaa60d949837b3c4e52872deddbad3260256d9d815b9" }, "downloads": -1, "filename": "django_method_override-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "0c9c4652599617b58c7c2f93f61aa49a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4346, "upload_time": "2018-09-12T21:09:21", "url": "https://files.pythonhosted.org/packages/d5/d1/a76820ded8c1a69b15200ef7af9ffd6408042d1d915b4db88b984956a81e/django_method_override-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c31b9184bb34a4fad38a179c92932627", "sha256": "3ff2791c8665932a1d15f4ec699422d5e06b49d5c0f2cd2ff32af9f7b87b4a70" }, "downloads": -1, "filename": "django-method-override-1.0.3.tar.gz", "has_sig": false, "md5_digest": "c31b9184bb34a4fad38a179c92932627", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4038, "upload_time": "2018-09-12T21:09:22", "url": "https://files.pythonhosted.org/packages/21/f8/8d41b023e2ab260532e3377c05b4a43d293f9eb862c62863680cf2054f45/django-method-override-1.0.3.tar.gz" } ] }