[Django]-Django.core.exceptions.ImproperlyConfigured: Requested setting REST_FRAMEWORK

1👍

you didn’t provide the full picture of the project structure so I am going to pin point what would usually cause this problem :

1. install pytest-django

$ pipenv install --dev pytest-django

2. create a file to define the settings module, and name it
pytest.ini

[pytest]

DJANGO_SETTINGS_MODULE=storefront.settings

replace "storefront" with your root folder and make sure the spelling is right , also this file should be on the root directory along side with the manage.py file .

3. in the terminal type pytest , remember to execute this command in the root directory (the same place you $ python manage.py runserver)

0👍

I resolved the issue by installing the pytest-django library in my environment

-2👍

check your installed apps in the project settings file and ensure that you have the REST_FRAMEWORK added and it doesn’t contain duplicates or other errors

👤franck

Leave a comment