Cannot configure pytest in my simple project

Question:

i have the folowing project structure, but when trying to run pytest in console i get error.
Is the problem in pytest.ini?

ERROR backend/tests/test_user.py - django.core.exceptions.ImproperlyConfigured: Requested setting REST_FRAMEWORK, but settings are not configured. You must either define the environment variable 
DJANGO_SETTINGS_MODULE or call

backend
  |-foodgram
        |-foodgram
        |-manage.py
  |-api
  |-users
  |-tests
  |-pytest.ini

in my pytest.ini

[pytest]
python_paths = foodgram/
DJANGO_SETTINGS_MODULE = foodgram.settings
norecursedirs = env/*
addopts = -vv -p no:cacheprovider
testpaths = tests/
python_files = test_*.py
Asked By: aleksander

||

Answers:

installed additional packages

pytest-pythonpath
Answered By: aleksander
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.