Задать вопрос
@now10

Ошибка при запуске сервера Django. Что делать?

Выпадает ошибка при запуске сервера Django. Не знаю как исправить

Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\Никита\PycharmProjects\pythonProject\venv\Lib\site-packages\django\core\checks\urls.py", line 136, in check_custom_error_handlers
handler = resolver.resolve_error_handler(status_code)
File "C:\Users\Никита\PycharmProjects\pythonProject\venv\Lib\site-packages\django\urls\resolvers.py", line 732, in resolve_error_handler
callback = getattr(self.urlconf_module, "handler%s" % view_type, None)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\Никита\PycharmProjects\pythonProject\venv\Lib\site-packages\django\utils\functional.py", line 47, in __get__
res = instance.__dict__[self.name] = self.func(instance)
~~~~~~~~~^^^^^^^^^^
File "C:\Users\Никита\PycharmProjects\pythonProject\venv\Lib\site-packages\django\urls\resolvers.py", line 711, in urlconf_module
return import_module(self.urlconf_name)
File "C:\Users\Никита\AppData\Local\Programs\Python\Python313\Lib\importlib\__init__.py", line 88, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 1022, in exec_module
File "", line 488, in _call_with_frames_removed
File "C:\Users\Никита\PycharmProjects\pythonProject\wikilit\wikilit\urls.py", line 6, in
path('', include('main.urls'))
~~~~~~~^^^^^^^^^^^^^
File "C:\Users\Никита\PycharmProjects\pythonProject\venv\Lib\site-packages\django\urls\conf.py", line 39, in include
urlconf_module = import_module(urlconf_module)
File "C:\Users\Никита\AppData\Local\Programs\Python\Python313\Lib\importlib\__init__.py", line 88, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 1022, in exec_module
File "", line 488, in _call_with_frames_removed
File "C:\Users\Никита\PycharmProjects\pythonProject\wikilit\main\urls.py", line 2, in
from . import views
File "C:\Users\Никита\PycharmProjects\pythonProject\wikilit\main\views.py", line 2, in
from django.hhtp import HttpResponse
ModuleNotFoundError: No module named 'django.hhtp'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Никита\AppData\Local\Programs\Python\Python313\Lib\threading.py", line 1041, in _bootstrap_inner
self.run()
~~~~~~~~^^
File "C:\Users\Никита\AppData\Local\Programs\Python\Python313\Lib\threading.py", line 992, in run
self._target(*self._args, **self._kwargs)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Никита\PycharmProjects\pythonProject\venv\Lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
~~^^^^^^^^^^^^^^^^^
File "C:\Users\Никита\PycharmProjects\pythonProject\venv\Lib\site-packages\django\core\management\commands\runserver.py", line 134, in inner_run
self.check(display_num_errors=True)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Никита\PycharmProjects\pythonProject\venv\Lib\site-packages\django\core\management\base.py", line 486, in check
all_issues = checks.run_checks(
app_configs=app_configs,
...<2 lines>...
databases=databases,
)
File "C:\Users\Никита\PycharmProjects\pythonProject\venv\Lib\site-packages\django\core\checks\registry.py", line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "C:\Users\Никита\PycharmProjects\pythonProject\venv\Lib\site-packages\django\core\checks\urls.py", line 138, in check_custom_error_handlers
path = getattr(resolver.urlconf_module, "handler%s" % status_code)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Никита\PycharmProjects\pythonProject\venv\Lib\site-packages\django\utils\functional.py", line 47, in __get__
res = instance.__dict__[self.name] = self.func(instance)
~~~~~~~~~^^^^^^^^^^
File "C:\Users\Никита\PycharmProjects\pythonProject\venv\Lib\site-packages\django\urls\resolvers.py", line 711, in urlconf_module
return import_module(self.urlconf_name)
File "C:\Users\Никита\AppData\Local\Programs\Python\Python313\Lib\importlib\__init__.py", line 88, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 1022, in exec_module
File "", line 488, in _call_with_frames_removed
File "C:\Users\Никита\PycharmProjects\pythonProject\wikilit\wikilit\urls.py", line 6, in
path('', include('main.urls'))
~~~~~~~^^^^^^^^^^^^^
File "C:\Users\Никита\PycharmProjects\pythonProject\venv\Lib\site-packages\django\urls\conf.py", line 39, in include
urlconf_module = import_module(urlconf_module)
File "C:\Users\Никита\AppData\Local\Programs\Python\Python313\Lib\importlib\__init__.py", line 88, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 1022, in exec_module
File "", line 488, in _call_with_frames_removed
File "C:\Users\Никита\PycharmProjects\pythonProject\wikilit\main\urls.py", line 2, in
from . import views
File "C:\Users\Никита\PycharmProjects\pythonProject\wikilit\main\views.py", line 2, in
from django.hhtp import HttpResponse
ModuleNotFoundError: No module named 'django.hhtp'
  • Вопрос задан
  • 102 просмотра
Подписаться 1 Простой Комментировать
Решения вопроса 1
AlexNest
@AlexNest
Работаю с Python/Django
from django.hhtp import HttpResponse

У вас ошибка в импорте
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы