Hey, I’ve just started coding with Django with a tutorial from an german YouTuber:
(here the vid to rebuild my error)
I just set up my Django Server wich was running correctly and after that I created the Modules blog and web. Since that step the Server/Site wont run anymore.
The Terminal in PyCharm:
(venv) C:\Users\Finn\PycharmProjects\tutorial\webseite>python manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File “C:\Users\Finn\AppData\Local\Programs\Python\Python39\lib\threading.py”, line 954, in _bootstrap_inner
self.run()
File “C:\Users\Finn\AppData\Local\Programs\Python\Python39\lib\threading.py”, line 892, in run
self._target(*self.args, **self.kwargs)
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\utils\autoreload.py”, line 53, in wrapper
fn(*args, **kwargs)
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\core\management\commands\runserver.py”, line 110, in inner_run
autoreload.raise_last_exception()
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\utils\autoreload.py”, line 76, in raise_last_exception
raise exception[1]
File "C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\core\management_init.py", line 357, in execute
autoreload.check_errors(django.setup)()
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\utils\autoreload.py”, line 53, in wrapper
fn(*args, **kwargs)
File "C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django_init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\apps\registry.py”, line 91, in populate
app_config = AppConfig.create(entry)
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\apps\config.py”, line 116, in create
mod = import_module(mod_path)
File "C:\Users\Finn\AppData\Local\Programs\Python\Python39\lib\importlib_init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1030, in _gcd_import
File “”, line 1007, in _find_and_load
File “”, line 972, in _find_and_load_unlocked
File “”, line 228, in _call_with_frames_removed
File “”, line 1030, in _gcd_import
File “”, line 1007, in find_and_load
File “”, line 984, in find_and_load_unlocked
ModuleNotFoundError: No module named ‘blog’
Traceback (most recent call last):
File “C:\Users\Finn\PycharmProjects\tutorial\webseite\manage.py”, line 22, in
main()
File “C:\Users\Finn\PycharmProjects\tutorial\webseite\manage.py”, line 18, in main
execute_from_command_line(sys.argv)
File "C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\core\management_init.py", line 401, in execute_from_command_line
utility.execute()
File "C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\core\management_init.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\core\management\base.py”, line 330, in run_from_argv
self.execute(*args, **cmd_options)
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\core\management\commands\runserver.py”, line 61, in execute
super().execute(*args, **options)
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\core\management\base.py”, line 371, in execute
output = self.handle(*args, **options)
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\core\management\commands\runserver.py”, line 96, in handle
self.run(**options)
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\core\management\commands\runserver.py”, line 103, in run
autoreload.run_with_reloader(self.inner_run, **options)
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\utils\autoreload.py”, line 618, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\utils\autoreload.py”, line 603, in start_django
reloader.run(django_main_thread)
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\utils\autoreload.py”, line 318, in run
self.run_loop()
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\utils\autoreload.py”, line 324, in run_loop
next(ticker)
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\utils\autoreload.py”, line 364, in tick
for filepath, mtime in self.snapshot_files():
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\utils\autoreload.py”, line 380, in snapshot_files
for file in self.watched_files():
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\utils\autoreload.py”, line 278, in watched_files
yield from iter_all_python_module_files()
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\utils\autoreload.py”, line 105, in iter_all_python_module_files
return iter_modules_and_files(modules, frozenset(_error_files))
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\utils\autoreload.py”, line 141, in iter_modules_and_files
resolved_path = path.resolve(strict=True).absolute()
File “C:\Users\Finn\AppData\Local\Programs\Python\Python39\lib\pathlib.py”, line 1204, in resolve
s = self._flavour.resolve(self, strict=strict)
File “C:\Users\Finn\AppData\Local\Programs\Python\Python39\lib\pathlib.py”, line 200, in resolve
return self._ext_to_normal(_getfinalpathname(s))
OSError: [WinError 123] Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch: ‘’
(venv) C:\Users\Finn\PycharmProjects\tutorial\webseite>python manage.py runserver
Traceback (most recent call last):
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\core\management\base.py”, line 330, in run_from_argv
self.execute(*args, **cmd_options)
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\core\management\commands\runserver.py”, line 61, in execute
super().execute(*args, **options)
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\core\management\base.py”, line 371, in execute
output = self.handle(*args, **options)
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\core\management\commands\runserver.py”, line 68, in handle
if not settings.DEBUG and not settings.ALLOWED_HOSTS:
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\conf_init_.py”, line 82, in getattr
self.setup(name)
File "C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\conf_init.py", line 69, in setup
self.wrapped = Settings(settings_module)
File "C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\conf_init.py", line 170, in init
mod = importlib.import_module(self.SETTINGS_MODULE)
File "C:\Users\Finn\AppData\Local\Programs\Python\Python39\lib\importlib_init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1030, in _gcd_import
File “”, line 1007, in _find_and_load
File “”, line 986, in _find_and_load_unlocked
File “”, line 680, in _load_unlocked
File “”, line 790, in exec_module
File “”, line 228, in _call_with_frames_removed
File “C:\Users\Finn\PycharmProjects\tutorial\webseite\webseite\settings.py”, line 14, in
from blog.models import Blog
ModuleNotFoundError: No module named ‘blog’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “C:\Users\Finn\PycharmProjects\tutorial\webseite\manage.py”, line 22, in
main()
File “C:\Users\Finn\PycharmProjects\tutorial\webseite\manage.py”, line 18, in main
execute_from_command_line(sys.argv)
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\core\management_init_.py”, line 401, in execute_from_command_line
utility.execute()
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\core\management_init_.py”, line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\core\management\base.py”, line 343, in run_from_argv
connections.close_all()
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\db\utils.py”, line 232, in close_all
for alias in self:
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\db\utils.py”, line 226, in iter
return iter(self.databases)
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\utils\functional.py”, line 48, in get
res = instance.dict[self.name] = self.func(instance)
File “C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\db\utils.py”, line 153, in databases
self.databases = settings.DATABASES
File "C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\conf_init.py", line 82, in getattr
self.setup(name)
File "C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\conf_init.py", line 69, in setup
self.wrapped = Settings(settings_module)
File "C:\Users\Finn\PycharmProjects\tutorial\venv\lib\site-packages\django\conf_init.py", line 170, in init
mod = importlib.import_module(self.SETTINGS_MODULE)
File "C:\Users\Finn\AppData\Local\Programs\Python\Python39\lib\importlib_init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1030, in _gcd_import
File “”, line 1007, in _find_and_load
File “”, line 986, in _find_and_load_unlocked
File “”, line 680, in _load_unlocked
File “”, line 790, in exec_module
File “”, line 228, in _call_with_frames_removed
File “C:\Users\Finn\PycharmProjects\tutorial\webseite\webseite\settings.py”, line 14, in
from blog.models import Blog
ModuleNotFoundError: No module named ‘blog’
Code in the urls.py:
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path(‘admin/’, admin.site.urls),
path(‘blog/’, include(‘blog.urls’)),
path(‘’, include(‘web.urls’)),
]