I am running the project and shows this error. I have googled and tried some of the solutions but doesn't seem to work.
File "/home/bs-094/Dev/backend/busgroup-backend/src/bus_portal_backend/apps/inquiry/forms/inquiry_details.py", line 2, in <module>
from ..models.inquiry import Inquiry
ValueError: attempted relative import beyond top-level package
My folder structure is
busgroup-backend
src
bus_portal_backend
apps
inquiry
models
_init_.py
inquiry.py
forms
inquiry_details.py
It would be great help is anyone helps me solve the problem. I am fairly new to django. Thanks
EDIT: Here's what solved my problem, I had to import in this way
from bus_portal_backend.apps.inquiry.models import Inquiry
Also, I was running with debugger. My script path was busgroup-backend/src/manage.py
, I changed it to /home/bs-094/Dev/backend/busgroup-backend/src/manage.py
, which made me run the project successfully.