flavors / django-graphql-jwt

JSON Web Token (JWT) authentication for Graphene Django
https://django-graphql-jwt.domake.io
MIT License
818 stars 170 forks source link

TypeError: Signal.__init__() got an unexpected keyword argument 'providing_args' #328

Open sojeda0521 opened 7 months ago

sojeda0521 commented 7 months ago

import graphql_jwt

class Mutations(ObjectType): ........ token_auth = graphql_jwt.ObtainJSONWebToken.Field() verify_token = graphql_jwt.Verify.Field() refresh_token = graphql_jwt.Refresh.Field()

............

TypeError: Signal.init() got an unexpected keyword argument 'providing_args' Watching for file changes with StatReloader Exception in thread django-main-thread: Traceback (most recent call last): File "/usr/local/lib/python3.11/threading.py", line 1045, in _bootstrap_inner self.run() File "/usr/local/lib/python3.11/threading.py", line 982, in run self._target(*self._args, *self._kwargs) File "/usr/local/lib/python3.11/site-packages/django/utils/autoreload.py", line 64, in wrapper fn(args, **kwargs) 2024-01-26 10:22:23 File "/usr/local/lib/python3.11/site-packages/django/core/management/commands/runserver.py", line 133, in inner_run self.check(display_num_errors=True) File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 485, in check all_issues = checks.run_checks( ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/django/core/checks/registry.py", line 88, in run_checks new_errors = check(app_configs=app_configs, databases=databases) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/django/core/checks/urls.py", line 42, in check_url_namespaces_unique all_namespaces = _load_all_namespaces(resolver) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/django/core/checks/urls.py", line 61, in _load_all_namespaces url_patterns = getattr(resolver, "url_patterns", []) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/django/utils/functional.py", line 47, in get res = instance.dict[self.name] = self.func(instance) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/django/urls/resolvers.py", line 735, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/django/utils/functional.py", line 47, in get res = instance.dict[self.name] = self.func(instance) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/django/urls/resolvers.py", line 728, in urlconf_module return import_module(self.urlconf_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "/app/dscustomer/urls.py", line 21, in from .schema import schema File "/app/dscustomer/schema.py", line 7, in import graphql_jwt File "/usr/local/lib/python3.11/site-packages/graphql_jwt/init.py", line 1, in from . import relay File "/usr/local/lib/python3.11/site-packages/graphql_jwt/relay.py", line 5, in from . import mixins File "/usr/local/lib/python3.11/site-packages/graphql_jwt/mixins.py", line 6, in from . import exceptions, signals File "/usr/local/lib/python3.11/site-packages/graphql_jwt/signals.py", line 3, in token_issued = Signal(providing_args=['request', 'user']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: Signal.init() got an unexpected keyword argument 'providing_args'

skochansky commented 6 months ago

Upgrate django-graphql-jwt to v0.4.0. The above error is fixed.

Av1nag commented 1 month ago

I'm getting

`ImportError: cannot import name 'ugettext' from 'django.utils.translation' (C:\realtime-projects\python-django\.venv\Lib\site-packages\django\utils\translation\__init__.py). Did you mean: 'gettext'?`

To suppress that i've imported below libraries in settings.

import django
from django.utils.translation import gettext, gettext_lazy
django.utils.translation.ugettext = gettext
django.utils.translation.ugettext_lazy = gettext_lazy

Then, I got the same issue, which is TypeError: Signal.__init__() got an unexpected keyword argument 'providing_args'

This issue is raising, when I'm adding "graphql_jwt.refresh_token.apps.RefreshTokenConfig" in INSTALLED_APPS of Django project.

More Details:

Libraries Version: Django==5.0.7 django-filter==24.2 django-graphql-auth==0.3.16 django-graphql-jwt==0.3.0 graphene==2.1.9 graphene-django==2.16.0 graphql-core==2.3.2 graphql-relay==2.0.1

Commands to raise the issue:

Install the above libraries in existing django project and run python manage.py makemigrations