-1

Created a new app named 'app1'. Have included the app name under INSTALLED_APPS settings. Got the error 'ModuleNotFoundError: No module named 'app1''

Request your help.

Meera K
  • 11
  • 5
  • no need to post a question for this my friend. Please just follow the official django tutorial and if you follow every step closely,it should be working. https://docs.djangoproject.com/en/4.0/intro/tutorial01/ – Pfinnn Jun 24 '22 at 13:06
  • 2
    The `app1` folder is in the `Project0` folder - think you need to include the full path in your settings `Project0.app1` – Iain Shelvington Jun 24 '22 at 13:06
  • Thank you dear Pfinnn. I am aware that I missed the point of creating the app into the main node and instead created it inside the Project0 folder. I am just trying to understand, what makes the error appear. Why shouldn't the app be created within the Project0 folder. – Meera K Jun 24 '22 at 13:13
  • Lain, could you please eloborate? I tried to give exactly as you mentioned, but got a new error. like below, jango.core.exceptions.ImproperlyConfigured: Cannot import 'app1'. Check that 'Project0.app1.apps.Ap1Config.name' is correct. I also checked apps.py and its like below, class app1Config(AppConfig): name = 'app1' – Meera K Jun 24 '22 at 13:26

1 Answers1

0

Thank you Lain! Modified the apps.py to

from django.apps import AppConfig


class app1Config(AppConfig):
    name = 'Project0.app1'

and the settings.py as

Project0.app1.apps.app1Config

runserver worked!

Meera K
  • 11
  • 5