Relative imports require the 'package' argument

前端 未结 5 1732
太阳男子
太阳男子 2021-02-07 01:44

I want to use Sphinx so it can automatically generate a pydoc for my python code but I\'m getting an error. What an I doing wrong?

conf.py sphinx config

5条回答
  •  南旧
    南旧 (楼主)
    2021-02-07 01:49

    DJANGO_SETTINGS_MODULE is expected to be a Python module identifier, not a filesystem path. Looking at the django/conf/__init__py file, it seems that a relative path to your settings module won't work there. You will need to move it below a directory listed in your sys.path, or you should add a parent directory to your sys.path and reference your settings module from there.

提交回复
热议问题