Search code examples
djangogrpcgrpc-python

how to fix "TypeError: requires_system_checks must be a list or tuple." caused by "py manage.py grpcrunserver" command?


it's my first time aksing a question here so please take easy on me if I do it bad (or whatever) and help! Thanks.

I have a project in which I need to use django_grpc_framework, and I've implemented the code but when I try to run the grpc server using "py manage.py grpcrunserver" I get the following error log:

(.venv) D:\Programming-stuff\PythonProjects\notification>py manage.py grpcrunserver
Traceback (most recent call last):
  File "D:\Programming-stuff\PythonProjects\notification\manage.py", line 22, in <module>
    main()
  File "D:\Programming-stuff\PythonProjects\notification\manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "d:\Programming-stuff\PythonProjects\notification\.venv\Lib\site-packages\django\core\management\__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "d:\Programming-stuff\PythonProjects\notification\.venv\Lib\site-packages\django\core\management\__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "d:\Programming-stuff\PythonProjects\notification\.venv\Lib\site-packages\django\core\management\__init__.py", line 275, in fetch_command
    klass = load_command_class(app_name, subcommand)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "d:\Programming-stuff\PythonProjects\notification\.venv\Lib\site-packages\django\core\management\__init__.py", line 49, in load_command_class
    return module.Command()
           ^^^^^^^^^^^^^^^^
  File "d:\Programming-stuff\PythonProjects\notification\.venv\Lib\site-packages\django\core\management\base.py", line 284, in __init__
    raise TypeError("requires_system_checks must be a list or tuple.")
TypeError: requires_system_checks must be a list or tuple.

(versions:Python 3.12.0, Django 5.0.1, djangogrpcframework 0.2.1, grpcio-tools 1.60.0, grpcio 1.60.0)

I've already tried to update django-extensions, but didn't resolve the issue. I also tried to use alternative ways like using "py services.py" to run my grpc server directly but it came up with troubles as well (like not loading apps, and it's not the only one for sure!). any help will be appreciated <3


Solution

  • Starting from Django 4.1 you cannot use boolean value as requires_system_checks in commands Django 4.1 Changelog and this package is using it in the grpcrunserver command in the 0.2.1 version which is also newest.

    Downgrade Django to 4.1 and it should start working