[英]When i execute unittest command “python3 -m unittest filepath/filename.py” it showing improperly configured error
當我執行單元測試命令時: python3 -m unittest filepath/filename.py
它會拋出一個配置不正確的錯誤,任何人都可以幫助解決這個問題,將不勝感激
錯誤:
django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but
settings are not configured. You must either define the environment variable
DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
您需要設置運行單元測試所需的設置文件。
在 Linux
$ export DJANGO_SETTINGS_MODULE=your_setting
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.