在 docker 容器中运行 makemigration 命令导致了这个错误,谁能帮我找出问题所在?
python3.7 manage.py makemigrations
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/reportlab/lib/utils.py", line 667, in open_for_read
return open_for_read_by_name(name,mode)
File "/usr/local/lib/python3.7/site-packages/reportlab/lib/utils.py", line 611, in open_for_read_by_name
return open(name,mode)
TypeError: expected str, bytes or os.PathLike object, not NoneType
最佳答案
请检查是否缺少 your_app/migrations/__init__.py
如果它不存在,django 可能会抛出这个异常,在这种情况下会抛出 solition
-> 添加__init__.py
再次执行python manage.py makemigrations
关于python - makemigration 导致错误 "TypeError: expected str, bytes or os.PathLike object, not NoneType",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56070036/