You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings. Bkr05041992 Bkr05041992 Bkr05041992 Follow Apr 26 '20 You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings. #django #restframework 1 reaction Add Comment 1 min read