I have two django applications in my project in my project named electron: the first api and the second elec_meter. The directories are organized as follows:
electron /
api/
views.py
...
elec_meter/
models.py
...
In the api / views.py file I want to import elec_meter / models.py.This is how I do it:
from ..elec_meter.models import *
But I get the following error message:
ValueError: attempted relative import beyond top-level package
or
from electron.elec_meter.models import *
In this case I receive this error message:
ModuleNotFoundError: No module named 'electron.elec_meter'
How can I solve this problem?