{"id":15024449,"url":"https://github.com/pedrobern/django-graphql-auth","last_synced_at":"2025-04-08T14:04:01.562Z","repository":{"id":37096267,"uuid":"234124856","full_name":"PedroBern/django-graphql-auth","owner":"PedroBern","description":"Django registration and authentication with GraphQL.","archived":false,"fork":false,"pushed_at":"2024-08-06T13:07:28.000Z","size":6414,"stargazers_count":333,"open_issues_count":74,"forks_count":108,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-04-08T14:03:46.928Z","etag":null,"topics":["authentication","django","graphene","graphql","python","registration","relay"],"latest_commit_sha":null,"homepage":"https://django-graphql-auth.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PedroBern.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-15T16:36:01.000Z","updated_at":"2025-03-16T20:10:12.000Z","dependencies_parsed_at":"2024-06-18T18:27:28.746Z","dependency_job_id":"512745f8-0285-4403-9e09-77c275daebd6","html_url":"https://github.com/PedroBern/django-graphql-auth","commit_stats":{"total_commits":240,"total_committers":17,"mean_commits":"14.117647058823529","dds":"0.16249999999999998","last_synced_commit":"face76be02928947e32358c5207b397d2457f99b"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PedroBern%2Fdjango-graphql-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PedroBern%2Fdjango-graphql-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PedroBern%2Fdjango-graphql-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PedroBern%2Fdjango-graphql-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PedroBern","download_url":"https://codeload.github.com/PedroBern/django-graphql-auth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247856541,"owners_count":21007620,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","django","graphene","graphql","python","registration","relay"],"created_at":"2024-09-24T20:00:22.419Z","updated_at":"2025-04-08T14:04:01.530Z","avatar_url":"https://github.com/PedroBern.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Django GraphQL Auth\n\n[Django](https://github.com/django/django) registration and authentication with GraphQL.\n\n[![downloads](https://img.shields.io/pypi/dm/django-graphql-auth)](https://pypistats.org/packages/django-graphql-auth)\n[![Codecov Coverage](https://img.shields.io/codecov/c/github/pedrobern/django-graphql-auth/master.svg?style=flat-square)](https://codecov.io/gh/pedrobern/django-graphql-auth/)\n[![Build Status](https://travis-ci.com/pedrobern/django-graphql-auth.svg?branch=master)](https://travis-ci.com/pedrobern/django-graphql-auth)\n[![Pypi](https://img.shields.io/pypi/v/django-graphql-auth.svg)](https://pypi.org/project/django-graphql-auth/)\n[![Documentation Status](https://readthedocs.org/projects/django-graphql-auth/badge/?version=latest)](https://django-graphql-auth.readthedocs.io/en/latest/?badge=latest)\n[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/pedrobern/django-graphql-auth/blob/master/CONTRIBUTING.md)\n\n## Demo\n\n![Demo Video](https://github.com/pedrobern/django-graphql-auth/blob/master/demo.gif)\n\n## About\n\nAbstract all the basic logic of handling user accounts out of your app,\nso you don't need to think about it and can **get up and running faster**.\n\nNo lock-in. When you are ready to implement your own code or this package\nis not up to your expectations , it's *easy to extend or switch to\nyour implementation*.\n\n\n## Documentation\n\nDocumentation is available at [read the docs](https://django-graphql-auth.readthedocs.io/en/latest/).\n\n\n## Features\n\n* [x] [Awesome docs](https://django-graphql-auth.readthedocs.io/en/latest/) :tada:\n* [x] Fully compatible with [Relay](https://github.com/facebook/relay\u003e)\n* [x] Works with **default or custom** user model\n* [x] JWT authentication *(with [Django GraphQL JWT](https://github.com/flavors/django-graphql-jwt))*\n* [x] User query with filters *(with [Django Filter](https://github.com/carltongibson/django-filter) and [Graphene Django](https://github.com/graphql-python/graphene-django))*\n* [x] User registration with email verification\n* [x] Add secondary email, with email verification too\n* [x] Resend activation email\n* [x] Retrieve/Update user\n* [x] Archive user\n* [x] Permanently delete user or make it inactive\n* [x] Turn archived user active again on login\n* [x] Track user status (archived, verified, secondary email)\n* [x] Password change\n* [x] Password reset through email\n* [x] Revoke user refresh tokens on account archive/delete/password change/reset\n* [x] All mutations return `success` and `errors`\n* [x] Default email templates *(you will customize though)*\n* [x] Customizable, no lock-in\n\n## Full Schema\n\n```python\n\nimport graphene\n\nfrom graphql_auth.schema import UserQuery, MeQuery\nfrom graphql_auth import mutations\n\nclass AuthMutation(graphene.ObjectType):\n    register = mutations.Register.Field()\n    verify_account = mutations.VerifyAccount.Field()\n    resend_activation_email = mutations.ResendActivationEmail.Field()\n    send_password_reset_email = mutations.SendPasswordResetEmail.Field()\n    password_reset = mutations.PasswordReset.Field()\n    password_set = mutations.PasswordSet.Field() # For passwordless registration\n    password_change = mutations.PasswordChange.Field()\n    update_account = mutations.UpdateAccount.Field()\n    archive_account = mutations.ArchiveAccount.Field()\n    delete_account = mutations.DeleteAccount.Field()\n    send_secondary_email_activation =  mutations.SendSecondaryEmailActivation.Field()\n    verify_secondary_email = mutations.VerifySecondaryEmail.Field()\n    swap_emails = mutations.SwapEmails.Field()\n    remove_secondary_email = mutations.RemoveSecondaryEmail.Field()\n\n    # django-graphql-jwt inheritances\n    token_auth = mutations.ObtainJSONWebToken.Field()\n    verify_token = mutations.VerifyToken.Field()\n    refresh_token = mutations.RefreshToken.Field()\n    revoke_token = mutations.RevokeToken.Field()\n\n\nclass Query(UserQuery, MeQuery, graphene.ObjectType):\n    pass\n\n\nclass Mutation(AuthMutation, graphene.ObjectType):\n    pass\n\n\nschema = graphene.Schema(query=Query, mutation=Mutation)\n```\n\n\n## Relay\n\nImport mutations from the ``relay`` module:\n\n```python\n\nfrom graphql_auth import relay\n\nclass AuthMutation(graphene.ObjectType):\n   register = relay.Register.Field()\n   # ...\n```\n\n\n## Example\n\nHandling user accounts becomes super easy.\n\n```python\nmutation {\n  register(\n    email: \"new_user@email.com\",\n    username: \"new_user\",\n    password1: \"123456super\",\n    password2: \"123456super\",\n  ) {\n    success,\n    errors,\n    token,\n    refreshToken\n  }\n}\n```\n\nCheck the status of the new user:\n\n```python\nu = UserModel.objects.last()\nu.status.verified\n# False\n```\n\nDuring the registration, an email with a verification link was sent.\n\n```python\nmutation {\n  verifyAccount(\n    token:\"\u003cTOKEN ON EMAIL LINK\u003e\",\n  ) {\n    success,\n    errors\n  }\n}\n```\n\nNow user is verified.\n\n```python\nu.status.verified\n# True\n```\n\nCheck the [installation guide](https://django-graphql-auth.readthedocs.io/en/latest/installation/) or jump to the [quickstart](https://django-graphql-auth.readthedocs.io/en/latest/quickstart/). Or if you prefer, browse the [api](https://django-graphql-auth.readthedocs.io/en/latest/api/).\n\n\n## Contributing\n\nSee [CONTRIBUTING.md](https://github.com/pedrobern/django-graphql-auth/blob/master/CONTRIBUTING.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedrobern%2Fdjango-graphql-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpedrobern%2Fdjango-graphql-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedrobern%2Fdjango-graphql-auth/lists"}