[Answered ]-From . import views ImportError: attempted relative import with no known parent package

1👍

try

from <app_name> import views

due to low reputation I am writing answer or else I could post it in comments

0👍

I had this problem too. It was happening because I was trying to run the script ‘urls.py’ by itself.
You need to run the django project as a whole by running the runserver command,
python manage.py runserver in the terminal

Leave a comment