Problem with Django: No module named 'myapp'

Question:

Good afternoon,
I’m new to Django and I’m trying to follow a tutorial. However, when running the server, the following error pops up:

File "C:UsersJorgePycharmProjectswebmysitemysiteurls.py", line 18, in <module>
from myapp.views import *
ModuleNotFoundError: No module named 'myapp'

This is a screenshot about how my files are right now:
screenshot

Asked By: user10821857

||

Answers:

Your myapp folder should be inside in your mysite folder

Answered By: kyore

Do the following:

  1. Move myapp to C:UsersJorgePycharmProjectswebmysite
  2. In mysitesettings.py, add an entry as myapp.apps.MyappConfig in the INSTALLED_APPS list.

Now do python manage.py runserver from C:UsersJorgePycharmProjectswebmysite.

Answered By: Arjun
  1. Go to ‘mysite’ –> ‘settings.py’
  2. write as it is, Under
    INSTALLED_APPS = [
    ‘myapp’,
Answered By: Susanta Pal

enter image description here

File "", line 228, in _call_with_frames_removed
File "C:UsersdivyaPycharmProjectsproject1myappmyappsettings.py", line 14, in
from myapp.app1 import views
ModuleNotFoundError: No module named ‘myapp.app1’

Good afternoon, I’m new to Django and I’m trying to follow a tutorial. However, when running the server, the following error pops up:

Answered By: Divyansh522
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.