Opened 4 years ago

Closed 4 years ago

#31408 closed Bug (invalid)

Django_runserver error

Reported by: MukeshRaikar Owned by:
Component: Error reporting Version: 3.0
Severity: Normal Keywords: reunserver error, appconfig, template, attribute error, attribute,
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Tim Graham)

" I am getting this error when i run the server after trying to create a template for the web and connecting that with heml. I added my apps.py config name in the settings.py -> INSTALLED APPS[ ...... ]

Want to knwo how to fix this. I amusing python v3.8.1 with latest djago version

Below is the error. I a not trying to use bootstrap.But creating a html and connecting to config file.

(venv) D:\Program Files\my_project\djangotest>python manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "D:\Program Files\my_project\venv\lib\site-packages\django\apps\config.py
", line 118, in create
    cls = getattr(mod, cls_name)
AttributeError: module 'django.apps' has no attribute 'DjangoAppConfig'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\ROY\AppData\Local\Programs\Python\Python38\lib\thread
ing.py", line 932, in _bootstrap_inner
    self.run()
  File "C:\Users\ROY\AppData\Local\Programs\Python\Python38\lib\thread
ing.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "D:\Program Files\my_project\venv\lib\site-packages\django\utils\autorelo
ad.py", line 53, in wrapper
    fn(*args, **kwargs)
  File "D:\Program Files\my_project\venv\lib\site-packages\django\core\managemen
t\commands\runserver.py", line 109, in inner_run
    autoreload.raise_last_exception()
  File "D:\Program Files\my_project\venv\lib\site-packages\django\utils\autorelo
ad.py", line 76, in raise_last_exception
    raise _exception[1]
  File "D:\Program Files\my_project\venv\lib\site-packages\django\core\managemen
t\__init__.py", line 357, in execute
    autoreload.check_errors(django.setup)()
  File "D:\Program Files\my_project\venv\lib\site-packages\django\utils\autorelo
ad.py", line 53, in wrapper
    fn(*args, **kwargs)
  File "D:\Program Files\my_project\venv\lib\site-packages\django\__init__.py",
line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "D:\Program Files\my_project\venv\lib\site-packages\django\apps\registry.
py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "D:\Program Files\my_project\venv\lib\site-packages\django\apps\config.py
", line 136, in create
    import_module(entry)
  File "C:\Users\ROY\AppData\Local\Programs\Python\Python38\lib\import
lib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'django.apps.DjangoAppConfig'
Traceback (most recent call last):
  File "manage.py", line 21, in <module>
    main()
  File "manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "D:\Program Files\my_project\venv\lib\site-packages\django\core\managemen
t\__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "D:\Program Files\my_project\venv\lib\site-packages\django\core\managemen
t\__init__.py", line 395, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "D:\Program Files\my_project\venv\lib\site-packages\django\core\managemen
t\base.py", line 328, in run_from_argv
    self.execute(*args, **cmd_options)
  File "D:\Program Files\my_project\venv\lib\site-packages\django\core\managemen
t\commands\runserver.py", line 60, in execute
    super().execute(*args, **options)
  File "D:\Program Files\my_project\venv\lib\site-packages\django\core\managemen
t\base.py", line 369, in execute
    output = self.handle(*args, **options)
  File "D:\Program Files\my_project\venv\lib\site-packages\django\core\managemen
t\commands\runserver.py", line 95, in handle
    self.run(**options)
  File "D:\Program Files\my_project\venv\lib\site-packages\django\core\managemen
t\commands\runserver.py", line 102, in run
    autoreload.run_with_reloader(self.inner_run, **options)
  File "D:\Program Files\my_project\venv\lib\site-packages\django\utils\autorelo
ad.py", line 599, in run_with_reloader
    start_django(reloader, main_func, *args, **kwargs)
  File "D:\Program Files\my_project\venv\lib\site-packages\django\utils\autorelo
ad.py", line 584, in start_django
    reloader.run(django_main_thread)
  File "D:\Program Files\my_project\venv\lib\site-packages\django\utils\autorelo
ad.py", line 299, in run
    self.run_loop()
  File "D:\Program Files\my_project\venv\lib\site-packages\django\utils\autorelo
ad.py", line 305, in run_loop
    next(ticker)
  File "D:\Program Files\my_project\venv\lib\site-packages\django\utils\autorelo
ad.py", line 345, in tick
    for filepath, mtime in self.snapshot_files():
  File "D:\Program Files\my_project\venv\lib\site-packages\django\utils\autorelo
ad.py", line 361, in snapshot_files
    for file in self.watched_files():
  File "D:\Program Files\my_project\venv\lib\site-packages\django\utils\autorelo
ad.py", line 260, in watched_files
    yield from iter_all_python_module_files()
  File "D:\Program Files\my_project\venv\lib\site-packages\django\utils\autorelo
ad.py", line 105, in iter_all_python_module_files
    return iter_modules_and_files(modules, frozenset(_error_files))
  File "D:\Program Files\my_project\venv\lib\site-packages\django\utils\autorelo
ad.py", line 141, in iter_modules_and_files
    resolved_path = path.resolve(strict=True).absolute()
  File "C:\Users\ROY\AppData\Local\Programs\Python\Python38\lib\pathli
b.py", line 1174, in resolve
    s = self._flavour.resolve(self, strict=strict)
  File "C:\Users\ROY\AppData\Local\Programs\Python\Python38\lib\pathli
b.py", line 200, in resolve
    return self._ext_to_normal(_getfinalpathname(s))
OSError: [WinError 123] The filename, directory name, or volume label syntax is
incorrect: '<frozen importlib._bootstrap>'

Change History (1)

comment:1 by Tim Graham, 4 years ago

Description: modified (diff)
Resolution: invalid
Status: newclosed

This looks like a mistake in your code rather than a bug in Django. Please see TicketClosingReasons/UseSupportChannels for ways to get help.

Note: See TracTickets for help on using tickets.
Back to Top