ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured

后端 未结 5 1805
别跟我提以往
别跟我提以往 2021-02-07 06:58

I\'m trying to make MongoDB and Django get on with each other the way I want them to. That\'s the error I\'m getting when trying to import viewsets from rest_framework_mongoengi

5条回答
  •  时光取名叫无心
    2021-02-07 07:50

    Most common cause of this is that you're just running python instead of using python manage.py shell, which means you need to manually set the DJANGO_SETTINGS_MODULE environment variable so Django knows where to find your settings (manage.py shell does that for you automatically).

    It's also possible (but less common) that you have something that's trying to import settings during the process of setting up your settings. To determine if that's the case, look at your settings file for any imports or function calls that might need to access settings (including code in things being imported by your settings file).

提交回复
热议问题