Requested setting DEFAULT_INDEX_TABLESPACE, but settings are not configured

用python3.4作单元测试的时候,遇到了Requested setting DEFAULT_INDEX_TABLESPACE, but settings are not configured。

网上查找的几种解决办法都不行,最终在PyCharm的单元测试配置中设置 DJANGO_SETTINGS_MODULE 如图:

Requested setting DEFAULT_INDEX_TABLESPACE, but settings are not configured_第1张图片


我试了下,这种办法下,manage.py、wsgi.py、单元测试类都不需要

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")

你可能感兴趣的:(python)