How do I adapt my import statements to my folder structure in Django?

I just set up a basic folder structure for a new project, however I am doing it a bit different than the standard file structure, since my front-end is in React and will be in a separate git repository. The problem is, my virtual environment is installed in the "backend-django" project and when I try to access my package imports (that I installed in my virtual env) in backend/settings.py it does not recognize them.

As an example: I pip installed django-environ into my venv but when I go to settings.py (like I normally do) and import environ, I get a 'no module named environ' error.

This is my first foray into Django (clearly). For reference, I have previously only used Flask for Python projects. Any help is appreciated!

A mockup of my basic folder structure is here: folder structure

I have already tried from backend-django import environ and from . import environ. I am still getting the same error.

Back to Top