{ "info": { "author": "Jose Padilla", "author_email": "jpadilla@getblimp.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "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", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Internet :: WWW/HTTP" ], "description": "`REST framework JWT Auth (FORK)`_\n=================================\n\nAdded a possibility to use custom `User` model. So that it is possible have several `User` models at the same project and keep authentication flow separately from each other.\n\nRecipe\n------\n\n1. Extend ```rest_framework_jwt.authentication.JSONWebTokenAuthentication``` and define which user model it should use.\n\n .. code:: python\n\n from rest_framework_jwt import authentication\n\n class MyJWTAuthentication(authentication.JSONWebTokenAuthentication):\n user_model = 'some_app.SomeUserModel'\n\n\n2. Define views that manipulate the token and tell them which user model to use. e.g.:\n\n .. code:: python\n\n from rest_framework_jwt.views import ObtainJSONWebToken, RefreshJSONWebToken\n\n obtain_jwt_token = ObtainJSONWebToken.as_view(user_model='some_app.SomeUserModel')\n\n urlpatterns = router.urls + [\n url(r'^api-token-auth/', obtain_jwt_token, name='auth-jwt-get'),\n ]\n\n3. Use your authentication class in your views.\n\n .. code:: python\n\n class TestView(ViewSet):\n authentication_classes = (MyJWTAuthentication, )\n\n\nIf you don't want to use default ```django.contrib.auth.authenticate``` which is using backends defined at ```settings.AUTHENTICATION_BACKENDS``` for all users, you need to write your own authentication handler and tell ```JSONWebTokenSerializer``` to use it by overriding ```JSONWebTokenSerializer.authenticate``` method.\n\n .. code:: python\n\n class MyJWTSerializer(serializers_jwt.JSONWebTokenSerializer):\n\n def authenticate(self, **credentials):\n return my_authenticate(**credentials)\n\n # your obtain token view then will look like this\n obtain_jwt_token = ObtainJSONWebToken.as_view(\n user_model='some_app.SomeUserModel',\n serializer_class=MyJWTSerializer\n )\n urlpatterns = router.urls + [\n url(r'^api-token-auth/', obtain_jwt_token, name='auth-jwt-get'),\n ]\n\n\nREST framework JWT Auth\n=======================\n\n|build-status-image| |pypi-version|\n\n**JSON Web Token Authentication support for Django REST Framework**\n\nFull documentation for the project is available at `docs`_.\n\nOverview\n--------\n\nThis package provides `JSON Web Token Authentication`_ support for\n`Django REST framework`_.\n\nIf you want to know more about JWT, check out the following resources:\n\n- DjangoCon 2014 - JSON Web Tokens `Video`_ \\| `Slides`_\n- `Auth with JSON Web Tokens`_\n- `JWT.io`_\n\nRequirements\n------------\n\n- Python (2.7, 3.3, 3.4, 3.5)\n- Django (1.8, 1.9, 1.10, 1.11)\n- Django REST Framework (3.1, 3.2, 3.3, 3.4, 3.5, 3.6)\n\nInstallation\n------------\n\nInstall using ``pip``\\ ...\n\n.. code:: bash\n\n $ pip install djangorestframework-jwt\n\nDocumentation & Support\n-----------------------\n\nFull documentation for the project is available at `docs`_.\n\nYou may also want to follow the `author`_ on Twitter.\n\n.. _REST framework JWT Auth (FORK): https://github.com/GetBlimp/django-rest-framework-jwt\n.. _docs: http://getblimp.github.io/django-rest-framework-jwt\n.. _JSON Web Token Authentication: http://tools.ietf.org/html/draft-ietf-oauth-json-web-token\n.. _Django REST framework: http://django-rest-framework.org/\n.. _Video: https://www.youtube.com/watch?v=825hodQ61bg\n.. _Slides: https://speakerdeck.com/jpadilla/djangocon-json-web-tokens\n.. _Auth with JSON Web Tokens: http://jpadilla.com/post/73791304724/auth-with-json-web-tokens\n.. _JWT.io: http://jwt.io/\n.. _author: https://twitter.com/blimp\n\n.. |build-status-image| image:: https://secure.travis-ci.org/GetBlimp/django-rest-framework-jwt.svg?branch=master\n :target: http://travis-ci.org/GetBlimp/django-rest-framework-jwt?branch=master\n.. |pypi-version| image:: https://img.shields.io/pypi/v/djangorestframework-jwt.svg\n :target: https://pypi.python.org/pypi/djangorestframework-jwt\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/RegioHelden/django-rest-framework-jwt/tree/custom_user_model", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "djangorestframework-jwt-custom-user", "package_url": "https://pypi.org/project/djangorestframework-jwt-custom-user/", "platform": "", "project_url": "https://pypi.org/project/djangorestframework-jwt-custom-user/", "project_urls": { "Homepage": "https://github.com/RegioHelden/django-rest-framework-jwt/tree/custom_user_model" }, "release_url": "https://pypi.org/project/djangorestframework-jwt-custom-user/1.11.1/", "requires_dist": null, "requires_python": "", "summary": "JSON Web Token based authentication for Django REST framework", "version": "1.11.1" }, "last_serial": 3078302, "releases": { "1.11.0": [ { "comment_text": "", "digests": { "md5": "835a50a3f7500628eaabfbb5da1c93c1", "sha256": "7fd6279096363fc2c9e40fa6a13ee79b61a54025fa3846698d0c71ba0a1b6123" }, "downloads": -1, "filename": "djangorestframework-jwt-custom-user-1.11.0.tar.gz", "has_sig": false, "md5_digest": "835a50a3f7500628eaabfbb5da1c93c1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10843, "upload_time": "2017-08-04T14:28:04", "url": "https://files.pythonhosted.org/packages/88/00/c2b3ccef5513dc631573c15cf7d7aa602f3967fcc4a8dc6883db619cbb17/djangorestframework-jwt-custom-user-1.11.0.tar.gz" } ], "1.11.1": [ { "comment_text": "", "digests": { "md5": "de4fdf4c9e6400f99534726233c27ebb", "sha256": "1679a68010d43f687431a2f0ec2397cc24a2ca650a46f7acd2723e87ccb98d14" }, "downloads": -1, "filename": "djangorestframework-jwt-custom-user-1.11.1.tar.gz", "has_sig": false, "md5_digest": "de4fdf4c9e6400f99534726233c27ebb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10918, "upload_time": "2017-08-07T12:26:27", "url": "https://files.pythonhosted.org/packages/f8/21/ca74ee4648712e4bf9b38005bf5fea7eb4171bf6b434ffd8d04ec9cf4dde/djangorestframework-jwt-custom-user-1.11.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "de4fdf4c9e6400f99534726233c27ebb", "sha256": "1679a68010d43f687431a2f0ec2397cc24a2ca650a46f7acd2723e87ccb98d14" }, "downloads": -1, "filename": "djangorestframework-jwt-custom-user-1.11.1.tar.gz", "has_sig": false, "md5_digest": "de4fdf4c9e6400f99534726233c27ebb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10918, "upload_time": "2017-08-07T12:26:27", "url": "https://files.pythonhosted.org/packages/f8/21/ca74ee4648712e4bf9b38005bf5fea7eb4171bf6b434ffd8d04ec9cf4dde/djangorestframework-jwt-custom-user-1.11.1.tar.gz" } ] }