Я создаю простой сайт с 3 страницами, но постоянно получаю ошибку. ModuleNotFoundError: Нет модуля с именем 'HomePage'

I cannot figure out why I keep getting the ModuleNotFoundError: 
No module named 'HomePage' error I'm fairly new to Django but 
have spent a majority of the day trying to figure out how to 
make a homepage where I could link a Homepage.html and have a 
different page on my original page. Any help would be 
appreciated this is my second question ever on here please be 
gentle.

    Below is the full error am getting.

        PS C:\Users\admin\Desktop\InstitutionFinderWebsite> 
        python 
        manage.py runserver;      
        Watching for file changes with StatReloader
        Exception in thread django-main-thread:
        Traceback (most recent call last):
        File "C:\python\python3.10.0\lib\threading.py", line 
       1009, in 
        _bootstrap_inner     
        self.run()
        File "C:\python\python3.10.0\lib\threading.py", line 
946, in 
        run
        self._target(*self._args, **self._kwargs)
        File 
"C:\Users\admin\.virtualenvs\InstitutionFinderWebsite- 
       jRRQ2QPD\lib\site-packages\django\utils\autoreload.py", 
line 64, 
        in wrapper
        fn(*args, **kwargs)
        File 
"C:\Users\admin\.virtualenvs\InstitutionFinderWebsite- 
       jRRQ2QPD\lib\site- 
       packages\django\core\management\commands\runserver.py", 
line 115, in inner_run
        autoreload.raise_last_exception()
        File 
 "C:\Users\admin\.virtualenvs\InstitutionFinderWebsite- 
       jRRQ2QPD\lib\site-packages\django\utils\autoreload.py", line 87, in raise_last_exception raise _exception[1]
          
File"C:\Users\admin\.virtualenvs\InstitutionFinderWebsite- 
       jRRQ2QPD\lib\site- 

packages\django\core\management_init_.py", строка 381, в execute autoreload.check_errors(django.setup)() Файл "C:\Users\admin.virtualenvs\InstitutionFinderWebsite-... jRRQ2QPD\lib\site-packages\django\utils\autoreload.py", строка 64, in wrapper fn(*args, **kwargs) Файл "C:\Users\admin.virtualenvs\InstitutionFinderWebsite- jRRQ2QPD\lib\site-packages\django_init_.py", строка 24, in setup apps.populate(settings.INSTALLED_APPS) Файл "C:\Users\admin.virtualenvs\InstitutionFinderWebsite-... jRRQ2QPD\lib\site-packages\django\apps\registry.py", строка 91, в populate app_config = AppConfig.create(entry) Файл "C:\Users\admin.virtualenvs\InstitutionFinderWebsite- jRRQ2QPD\lib\site-packages\django\apps\config.py", строка 223, in создать import_module(entry) Файл "C:\python\python3.10.0\lib\importlib_init_.py", строка 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) Файл "", строка 1050, in _gcd_import Файл "", строка 1027, в _find_and_load Файл "", строка 992, в _find_and_load_unlocked Файл "", строка 241, в _call_with_frames_removed
Файл "", строка 1050, в _gcd_import Файл "", строка 1027, в _find_and_load Файл "", строка 1004, в _find_and_load_unlocked
ModuleNotFoundError: Нет модуля с именем 'HomePage'

Обновите следующее INSTALLED_APPS в файле settings.py

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'PrivateSchools',
    'PublicSchools',
    ]

Просто удалите HomePage.html из списка. INSTALLED_APPS должен содержать только имя приложения.

Вернуться на верх