iMerica / dj-rest-auth

Authentication for Django Rest Framework
https://dj-rest-auth.readthedocs.io/en/latest/index.html
MIT License
1.64k stars 306 forks source link

Demo Project does not work #456

Closed atvKumar closed 1 year ago

atvKumar commented 1 year ago

The demo project is not working with Windows 10, python 3.10.8

(.venv) PS D:\dj-rest-auth\demo> python manage.py migrate --settings=demo.settings --noinput
Traceback (most recent call last):
  File "D:\dj-rest-auth\demo\manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "D:\dj-rest-auth\demo\.venv\lib\site-packages\django\core\management\__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "D:\dj-rest-auth\demo\.venv\lib\site-packages\django\core\management\__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "D:\dj-rest-auth\demo\.venv\lib\site-packages\django\core\management\base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "D:\dj-rest-auth\demo\.venv\lib\site-packages\django\core\management\base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "D:\dj-rest-auth\demo\.venv\lib\site-packages\django\core\management\base.py", line 89, in wrapped
    res = handle_func(*args, **kwargs)
  File "D:\dj-rest-auth\demo\.venv\lib\site-packages\django\core\management\commands\migrate.py", line 75, in handle
    self.check(databases=[database])
  File "D:\dj-rest-auth\demo\.venv\lib\site-packages\django\core\management\base.py", line 419, in check
    all_issues = checks.run_checks(
  File "D:\dj-rest-auth\demo\.venv\lib\site-packages\django\core\checks\registry.py", line 76, in run_checks
    new_errors = check(app_configs=app_configs, databases=databases)
  File "D:\dj-rest-auth\demo\.venv\lib\site-packages\django\core\checks\urls.py", line 13, in check_url_config
    return check_resolver(resolver)
  File "D:\dj-rest-auth\demo\.venv\lib\site-packages\django\core\checks\urls.py", line 23, in check_resolver
    return check_method()
  File "D:\dj-rest-auth\demo\.venv\lib\site-packages\django\urls\resolvers.py", line 416, in check
    for pattern in self.url_patterns:
  File "D:\dj-rest-auth\demo\.venv\lib\site-packages\django\utils\functional.py", line 48, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "D:\dj-rest-auth\demo\.venv\lib\site-packages\django\urls\resolvers.py", line 602, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "D:\dj-rest-auth\demo\.venv\lib\site-packages\django\utils\functional.py", line 48, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "D:\dj-rest-auth\demo\.venv\lib\site-packages\django\urls\resolvers.py", line 595, in urlconf_module
    return import_module(self.urlconf_name)
  File "C:\Users\dell\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "D:\dj-rest-auth\demo\demo\urls.py", line 7, in <module>
    schema_view = get_schema_view(
  File "D:\dj-rest-auth\demo\.venv\lib\site-packages\drf_yasg\views.py", line 67, in get_schema_view
    _generator_class = generator_class or swagger_settings.DEFAULT_GENERATOR_CLASS
  File "D:\dj-rest-auth\demo\.venv\lib\site-packages\drf_yasg\app_settings.py", line 122, in __getattr__
    val = perform_import(val, attr)
  File "D:\dj-rest-auth\demo\.venv\lib\site-packages\rest_framework\settings.py", line 166, in perform_import
    return import_from_string(val, setting_name)
  File "D:\dj-rest-auth\demo\.venv\lib\site-packages\rest_framework\settings.py", line 177, in import_from_string
    return import_string(val)
  File "D:\dj-rest-auth\demo\.venv\lib\site-packages\django\utils\module_loading.py", line 17, in import_string
    module = import_module(module_path)
  File "C:\Users\dell\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "D:\dj-rest-auth\demo\.venv\lib\site-packages\drf_yasg\generators.py", line 19, in <module>
    from .inspectors.field import get_basic_type_info, get_queryset_field, get_queryset_from_view
  File "D:\dj-rest-auth\demo\.venv\lib\site-packages\drf_yasg\inspectors\__init__.py", line 5, in <module>
    from .field import (
  File "D:\dj-rest-auth\demo\.venv\lib\site-packages\drf_yasg\inspectors\field.py", line 406, in <module>
    (serializers.NullBooleanField, (openapi.TYPE_BOOLEAN, None)),
AttributeError: module 'rest_framework.serializers' has no attribute 'NullBooleanField'. Did you mean: 'BooleanField'?
JosefTaylor commented 1 year ago

I'm having the same problem- are you using Django 4.0 or later? I suspect that's the culprit, but I don't know.

foobarbecue commented 1 year ago

Appears to be addressed by https://github.com/iMerica/dj-rest-auth/pull/454

atvKumar commented 1 year ago

Appears to be addressed by #454

Yes the line djangorestframework>=3.11.0,<3.14.0 appears to have solved the problem. But it is still not yet pulled and is still open https://github.com/iMerica/dj-rest-auth/pull/454

I will close this, Sorry for not spending more time searching.

foobarbecue commented 1 year ago

@atvKumar actually I would recommend leaving it open until the PR gets pulled. It is, after all, still an open issue. I meant to say "eventually will be addressed by #454" but was in a hurry.