Name | django-graphql-jwt JSON |
Version |
0.4.0
JSON |
| download |
home_page | |
Summary | JSON Web Token for Django GraphQL. |
upload_time | 2023-08-04 09:47:07 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.6 |
license | |
keywords |
django
graphql
jwt
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<p align="center">
<a href="https://django-graphql-jwt.domake.io/"><img width="420px" src="https://django-graphql-jwt.domake.io/_static/logo.png" alt='Django GraphQL JWT'></a>
</p>
<p align="center">
JSON Web Token authentication for Django GraphQL.
<br>Fantastic <strong>documentation</strong> is available at <a href="https://django-graphql-jwt.domake.io">https://django-graphql-jwt.domake.io</a>.
</p>
<p align="center">
<a href="https://github.com/flavors/django-graphql-jwt/actions">
<img src="https://github.com/flavors/django-graphql-jwt/actions/workflows/test-suite.yml/badge.svg" alt="Test">
</a>
<a href="https://codecov.io/gh/flavors/django-graphql-jwt">
<img src="https://img.shields.io/codecov/c/github/flavors/django-graphql-jwt?color=%2334D058" alt="Coverage">
</a>
<a href="https://www.codacy.com/gh/flavors/django-graphql-jwt/dashboard">
<img src="https://app.codacy.com/project/badge/Grade/4f9fd439fbc74be88a215b9ed2abfcf9" alt="Codacy">
</a>
<a href="https://pypi.python.org/pypi/django-graphql-jwt">
<img src="https://img.shields.io/pypi/v/django-graphql-jwt.svg" alt="Package version">
</a>
</p>
## Installation
Install last stable version from Pypi:
```sh
pip install django-graphql-jwt
```
Add `AuthenticationMiddleware` middleware to your *MIDDLEWARE* settings:
```py
MIDDLEWARE = [
# ...
"django.contrib.auth.middleware.AuthenticationMiddleware",
# ...
]
```
Add `JSONWebTokenMiddleware` middleware to your *GRAPHENE* settings:
```py
GRAPHENE = {
"SCHEMA": "mysite.myschema.schema",
"MIDDLEWARE": [
"graphql_jwt.middleware.JSONWebTokenMiddleware",
],
}
```
Add `JSONWebTokenBackend` backend to your *AUTHENTICATION_BACKENDS*:
```py
AUTHENTICATION_BACKENDS = [
"graphql_jwt.backends.JSONWebTokenBackend",
"django.contrib.auth.backends.ModelBackend",
]
```
## Schema
Add *django-graphql-jwt* mutations to the root schema:
```py
import graphene
import graphql_jwt
class Mutation(graphene.ObjectType):
token_auth = graphql_jwt.ObtainJSONWebToken.Field()
verify_token = graphql_jwt.Verify.Field()
refresh_token = graphql_jwt.Refresh.Field()
schema = graphene.Schema(mutation=Mutation)
```
Raw data
{
"_id": null,
"home_page": "",
"name": "django-graphql-jwt",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "django,graphql,jwt",
"author": "",
"author_email": "Dani <dani@domake.io>",
"download_url": "https://files.pythonhosted.org/packages/a8/44/6781e0ef4438f9f8b8b0fc39d4e874659b555bc57159243faee99c66483e/django_graphql_jwt-0.4.0.tar.gz",
"platform": null,
"description": "<p align=\"center\">\n <a href=\"https://django-graphql-jwt.domake.io/\"><img width=\"420px\" src=\"https://django-graphql-jwt.domake.io/_static/logo.png\" alt='Django GraphQL JWT'></a>\n</p>\n\n<p align=\"center\">\n JSON Web Token authentication for Django GraphQL.\n <br>Fantastic <strong>documentation</strong> is available at <a href=\"https://django-graphql-jwt.domake.io\">https://django-graphql-jwt.domake.io</a>.\n</p>\n<p align=\"center\">\n <a href=\"https://github.com/flavors/django-graphql-jwt/actions\">\n <img src=\"https://github.com/flavors/django-graphql-jwt/actions/workflows/test-suite.yml/badge.svg\" alt=\"Test\">\n </a>\n <a href=\"https://codecov.io/gh/flavors/django-graphql-jwt\">\n <img src=\"https://img.shields.io/codecov/c/github/flavors/django-graphql-jwt?color=%2334D058\" alt=\"Coverage\">\n </a>\n <a href=\"https://www.codacy.com/gh/flavors/django-graphql-jwt/dashboard\">\n <img src=\"https://app.codacy.com/project/badge/Grade/4f9fd439fbc74be88a215b9ed2abfcf9\" alt=\"Codacy\">\n </a>\n <a href=\"https://pypi.python.org/pypi/django-graphql-jwt\">\n <img src=\"https://img.shields.io/pypi/v/django-graphql-jwt.svg\" alt=\"Package version\">\n </a>\n</p>\n\n## Installation\n\nInstall last stable version from Pypi:\n\n```sh\npip install django-graphql-jwt\n```\n\nAdd `AuthenticationMiddleware` middleware to your *MIDDLEWARE* settings:\n\n\n```py\nMIDDLEWARE = [\n # ...\n \"django.contrib.auth.middleware.AuthenticationMiddleware\",\n # ...\n]\n```\n\nAdd `JSONWebTokenMiddleware` middleware to your *GRAPHENE* settings:\n\n```py\nGRAPHENE = {\n \"SCHEMA\": \"mysite.myschema.schema\",\n \"MIDDLEWARE\": [\n \"graphql_jwt.middleware.JSONWebTokenMiddleware\",\n ],\n}\n```\n\nAdd `JSONWebTokenBackend` backend to your *AUTHENTICATION_BACKENDS*:\n\n```py\nAUTHENTICATION_BACKENDS = [\n \"graphql_jwt.backends.JSONWebTokenBackend\",\n \"django.contrib.auth.backends.ModelBackend\",\n]\n```\n\n## Schema\n\nAdd *django-graphql-jwt* mutations to the root schema:\n\n```py\nimport graphene\nimport graphql_jwt\n\n\nclass Mutation(graphene.ObjectType):\n token_auth = graphql_jwt.ObtainJSONWebToken.Field()\n verify_token = graphql_jwt.Verify.Field()\n refresh_token = graphql_jwt.Refresh.Field()\n\n\nschema = graphene.Schema(mutation=Mutation)\n```\n",
"bugtrack_url": null,
"license": "",
"summary": "JSON Web Token for Django GraphQL.",
"version": "0.4.0",
"project_urls": {
"changelog": "https://django-graphql-jwt.domake.io/changelog",
"documentation": "https://django-graphql-jwt.domake.io",
"homepage": "https://github.com/flavors/django-graphql-jwt",
"repository": "https://github.com/flavors/django-graphql-jwt"
},
"split_keywords": [
"django",
"graphql",
"jwt"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "96829b6e9425515ccec08894f3dbdd2b439244859c5516777a576b929eb6f854",
"md5": "94b2103bdb77aac8cca494782e13c0e3",
"sha256": "5823aa8ac9bf0b7a6e3b2febd029598b332c41fe9043d89900c116fcecd23f5e"
},
"downloads": -1,
"filename": "django_graphql_jwt-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "94b2103bdb77aac8cca494782e13c0e3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 47080,
"upload_time": "2023-08-04T09:47:05",
"upload_time_iso_8601": "2023-08-04T09:47:05.896929Z",
"url": "https://files.pythonhosted.org/packages/96/82/9b6e9425515ccec08894f3dbdd2b439244859c5516777a576b929eb6f854/django_graphql_jwt-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a8446781e0ef4438f9f8b8b0fc39d4e874659b555bc57159243faee99c66483e",
"md5": "e4e76f549f32176b632d57b15110aaaa",
"sha256": "537972519f0deeec7a0e4a306ddfed1fe385266ef61c9f78c54cd04ac01a171e"
},
"downloads": -1,
"filename": "django_graphql_jwt-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "e4e76f549f32176b632d57b15110aaaa",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 20668,
"upload_time": "2023-08-04T09:47:07",
"upload_time_iso_8601": "2023-08-04T09:47:07.515590Z",
"url": "https://files.pythonhosted.org/packages/a8/44/6781e0ef4438f9f8b8b0fc39d4e874659b555bc57159243faee99c66483e/django_graphql_jwt-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-04 09:47:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "flavors",
"github_project": "django-graphql-jwt",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "django-graphql-jwt"
}