Can`t run existing Django project - python

I downloaded python 3.7 and django framework.
There is an existing project I want to run and execute. I've added python interpreter, there wasn't any errors and then I tried to run it and... as ypu can see there are a lot of errors. I don't know the reason and a way to solve that problem
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Python\lib\threading.py", line 916, in _bootstrap_inner
self.run()
File "C:\Python\lib\threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "C:\Python\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "C:\Python\lib\site-packages\django\core\management\commands\runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "C:\Python\lib\site-packages\django\utils\autoreload.py", line 77, in raise_last_exception
raise _exception[0](_exception[1]).with_traceback(_exception[2])
File "C:\Python\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "C:\Python\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Python\lib\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Python\lib\site-packages\django\apps\config.py", line 90, in create
module = import_module(entry)
File "C:\Python\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 978, in _gcd_import
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 948, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'social_django'
Traceback (most recent call last):
File "C:/Users/skantorp/Documents/Univer/Task02/SSPLS/manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "C:\Python\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
utility.execute()
File "C:\Python\lib\site-packages\django\core\management\__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python\lib\site-packages\django\core\management\base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Python\lib\site-packages\django\core\management\commands\runserver.py", line 60, in execute
super().execute(*args, **options)
File "C:\Python\lib\site-packages\django\core\management\base.py", line 364, in execute
output = self.handle(*args, **options)
File "C:\Python\lib\site-packages\django\core\management\commands\runserver.py", line 95, in handle
self.run(**options)
File "C:\Python\lib\site-packages\django\core\management\commands\runserver.py", line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "C:\Python\lib\site-packages\django\utils\autoreload.py", line 577, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "C:\Python\lib\site-packages\django\utils\autoreload.py", line 562, in start_django
reloader.run(django_main_thread)
File "C:\Python\lib\site-packages\django\utils\autoreload.py", line 280, in run
self.run_loop()
File "C:\Python\lib\site-packages\django\utils\autoreload.py", line 286, in run_loop
next(ticker)
File "C:\Python\lib\site-packages\django\utils\autoreload.py", line 326, in tick
for filepath, mtime in self.snapshot_files():
File "C:\Python\lib\site-packages\django\utils\autoreload.py", line 342, in snapshot_files
for file in self.watched_files():
File "C:\Python\lib\site-packages\django\utils\autoreload.py", line 241, in watched_files
yield from iter_all_python_module_files()
File "C:\Python\lib\site-packages\django\utils\autoreload.py", line 103, in iter_all_python_module_files
return iter_modules_and_files(modules, frozenset(_error_files))
File "C:\Python\lib\site-packages\django\utils\autoreload.py", line 128, in iter_modules_and_files
if not path.exists():
File "C:\Python\lib\pathlib.py", line 1319, in exists
self.stat()
File "C:\Python\lib\pathlib.py", line 1139, in stat
return self._accessor.stat(self)
File "C:\Python\lib\pathlib.py", line 390, in wrapped
return strfunc(str(pathobj), *args)
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<frozen importlib._bootstrap>'
Process finished with exit code 1
Does anyone have any ideas? If you do please let me know. Any help appreciates

Related

error after deleting app from django project

I am new to Django so please excuse my ignorance...
I have been working on an e-commerce project with django in VS code. Everything was working fine until I thought I'd add an account feature. From the terminal I did a startapp account. Not long after doing this, I decided to go another route and not make an account app. So I deleted the account directory from the explorer from right clicking and selecting the delete option. Now, when I ran the server to make sure I didn't break anything, I did in fact break everything. I am using the venv and I do have my Onedrive open since the directory is saved in there. This is the error I got:
(Django_projects) PS C:\Users\kylec\OneDrive\Documents\school_files\team_project\Django\bookify> py manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "c:\users\kylec\appdata\local\programs\python\python39\lib\threading.py", line 954, in _bootstrap_inner
self.run()
File "c:\users\kylec\appdata\local\programs\python\python39\lib\threading.py", line 892, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\core\management\commands\runserver.py", line 125, in inner_run
autoreload.raise_last_exception()
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\utils\autoreload.py", line 87, in raise_last_exception
raise _exception[1]
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\core\management\__init__.py",
line 398, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\apps\config.py", line 193, in
create
import_module(entry)
File "c:\users\kylec\appdata\local\programs\python\python39\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'account'
Traceback (most recent call last):
File "C:\Users\kylec\OneDrive\Documents\school_files\team_project\Django\bookify\manage.py", line 22, in <module>
main()
File "C:\Users\kylec\OneDrive\Documents\school_files\team_project\Django\bookify\manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\core\management\__init__.py",
line 446, in execute_from_command_line
utility.execute()
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\core\management\__init__.py",
line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\core\management\base.py", line 402, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\core\management\commands\runserver.py", line 74, in execute
super().execute(*args, **options)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\core\management\base.py", line 448, in execute
output = self.handle(*args, **options)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\core\management\commands\runserver.py", line 111, in handle
self.run(**options)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\core\management\commands\runserver.py", line 118, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\utils\autoreload.py", line 680, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\utils\autoreload.py", line 661, in start_django
reloader.run(django_main_thread)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\utils\autoreload.py", line 344, in run
self.run_loop()
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\utils\autoreload.py", line 350, in run_loop
next(ticker)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\utils\autoreload.py", line 390, in tick
for filepath, mtime in self.snapshot_files():
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\utils\autoreload.py", line 411, in snapshot_files
for file in self.watched_files():
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\utils\autoreload.py", line 304, in watched_files
yield from iter_all_python_module_files()
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\utils\autoreload.py", line 120, in iter_all_python_module_files
return iter_modules_and_files(modules, frozenset(_error_files))
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\utils\autoreload.py", line 160, in iter_modules_and_files
if not path.exists():
File "c:\users\kylec\appdata\local\programs\python\python39\lib\pathlib.py", line 1407, in exists
self.stat()
File "c:\users\kylec\appdata\local\programs\python\python39\lib\pathlib.py", line 1221, in stat
return self._accessor.stat(self)
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<frozen importlib._bootstrap>'
(Django_projects) PS C:\Users\kylec\OneDrive\Documents\school_files\team_project\Django\bookify>
* History restored
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\threading.py", line 954, in _bootstrap_inner
self.run()
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\threading.py", line 892, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\commands\runserver.py", line 125, in inner_run
autoreload.raise_last_exception()
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 87, in raise_last_exception
raise _exception[1]
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\__init__.py", line 398, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\apps\config.py", line 193, in create
import_module(entry)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'account'
Traceback (most recent call last):
File "C:\Users\kylec\OneDrive\Documents\school_files\team_project\Django\bookify\manage.py", line 22, in <module>
main()
File "C:\Users\kylec\OneDrive\Documents\school_files\team_project\Django\bookify\manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\__init__.py", line 446, in execute_from_command_line
utility.execute()
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\__init__.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\base.py", line 402, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\commands\runserver.py", line 74, in execute
super().execute(*args, **options)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\base.py", line 448, in execute
output = self.handle(*args, **options)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\commands\runserver.py", line 111, in handle
self.run(**options)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\commands\runserver.py", line 118, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 680, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 661, in start_django
reloader.run(django_main_thread)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 344, in run
self.run_loop()
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 350, in run_loop
next(ticker)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 390, in tick
for filepath, mtime in self.snapshot_files():
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 411, in snapshot_files
for file in self.watched_files():
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 304, in watched_files
yield from iter_all_python_module_files()
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 120, in iter_all_python_module_files
return iter_modules_and_files(modules, frozenset(_error_files))
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 160, in iter_modules_and_files
if not path.exists():
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\pathlib.py", line 1407, in exists
self.stat()
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\pathlib.py", line 1221, in stat
return self._accessor.stat(self)
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<frozen importlib._bootstrap>'
Thinking that since I deleted "account" I need to revert all the migrations I went to the terminal and tried this:
py manage.py migrate account zero
The following is the error that I got:
Traceback (most recent call last):
File "C:\Users\kylec\OneDrive\Documents\school_files\team_project\Django\bookify\manage.py", line 22, in <module>
main()
File "C:\Users\kylec\OneDrive\Documents\school_files\team_project\Django\bookify\manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\__init__.py", line 446, in execute_from_command_line
utility.execute()
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\__init__.py", line 420, in execute
django.setup()
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\apps\config.py", line 193, in create
import_module(entry)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\importlib\__init__.py", line 127, in import_module
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'account'
I restored the file and then opened every folder (urls, views, etc) and deleted everything in the files. I did py manage.py makemigrations account and then py manage.py squashmigrations account
-everything is up and running again

Is there a way to solve OS Error in Django Project

I started learning Django recently.
I first ran the virtual enviroment, then installed Django and then python manage.py runserverbut im recieving this error:
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\123\AppData\Local\Programs\Python\Python39\lib\threading.py", line 950, in _bootstrap_inner
self.run()
File "C:\Users\123\AppData\Local\Programs\Python\Python39\lib\threading.py", line 888, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper fn(*args, **kwargs)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\core\management\commands\runserver.py", line 110, in inner_run
autoreload.raise_last_exception()
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\utils\autoreload.py", line 76, in raise_last_exception
raise _exception[1]
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\core\management\__init__.py", line 357, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper fn(*args, **kwargs)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\apps\config.py", line 90, in create
module = import_module(entry)
File "C:\Users\123\AppData\Local\Programs\Python\Python39\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'allauth'
Traceback (most recent call last):
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\manage.py", line 14, in <module>
execute_from_command_line(sys.argv)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\core\management\__init__.py", line 401, in execute_from_command_line
utility.execute()
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\core\management\__init__.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\core\management\base.py", line 330, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\core\management\commands\runserver.py", line 61, in execute
super().execute(*args, **options)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\core\management\base.py", line 371, in execute
output = self.handle(*args, **options)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\core\management\commands\runserver.py", line 96, in handle
self.run(**options)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\core\management\commands\runserver.py", line 103, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\utils\autoreload.py", line 618, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\utils\autoreload.py", line 603, in start_django
reloader.run(django_main_thread)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\utils\autoreload.py", line 318, in run
self.run_loop()
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\utils\autoreload.py", line 324, in run_loop
next(ticker)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\utils\autoreload.py", line 364, in tick
for filepath, mtime in self.snapshot_files():
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\utils\autoreload.py", line 380, in snapshot_files
for file in self.watched_files():
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\utils\autoreload.py", line 278, in watched_files
yield from iter_all_python_module_files()
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\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\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\utils\autoreload.py", line 141, in iter_modules_and_files
resolved_path = path.resolve(strict=True).absolute()
File "C:\Users\123\AppData\Local\Programs\Python\Python39\lib\pathlib.py", line 1204, in resolve
s = self._flavour.resolve(self, strict=strict)
File "C:\Users\123\AppData\Local\Programs\Python\Python39\lib\pathlib.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>'
I downloaded this https://github.com/justdjango/django-react-boilerplate project and was trying to run this in the terminal.
If someone can help please. Thankyou.
The problem is in your setup. After activating your environment, run this command;
pip install -r requirements.txt
As you downloaded the code from the mentioned link, that also has a file, requirements.txt which shows all the modules required to make the project run and the above command will install all of them at once.
After that run;
python manage.py makemigrations
python manage.py migrate
Then you will be ready;
python manage.py ruunserver

Django OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect

I am trying to run an opensource project in my computer. But I am getting this error. Please experienced a person share your thought. I don't understand how I can solve this issue. I am using python 3.6 and django 2.X version.
Traceback (most recent call last):
File "C:/Users/Asus/Desktop/Fiverr/vulunteer/manage.py", line 37, in <module>
execute_from_command_line(sys.argv)
File "C:\Python37\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
utility.execute()
File "C:\Python37\lib\site-packages\django\core\management\__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python37\lib\site-packages\django\core\management\base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Python37\lib\site-packages\django\core\management\commands\runserver.py", line 60, in execute
super().execute(*args, **options)
File "C:\Python37\lib\site-packages\django\core\management\base.py", line 364, in execute
output = self.handle(*args, **options)
File "C:\Python37\lib\site-packages\django\core\management\commands\runserver.py", line 95, in handle
self.run(**options)
File "C:\Python37\lib\site-packages\django\core\management\commands\runserver.py", line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "C:\Python37\lib\site-packages\django\utils\autoreload.py", line 598, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "C:\Python37\lib\site-packages\django\utils\autoreload.py", line 583, in start_django
reloader.run(django_main_thread)
File "C:\Python37\lib\site-packages\django\utils\autoreload.py", line 301, in run
self.run_loop()
File "C:\Python37\lib\site-packages\django\utils\autoreload.py", line 307, in run_loop
next(ticker)
File "C:\Python37\lib\site-packages\django\utils\autoreload.py", line 347, in tick
for filepath, mtime in self.snapshot_files():
File "C:\Python37\lib\site-packages\django\utils\autoreload.py", line 363, in snapshot_files
for file in self.watched_files():
File "C:\Python37\lib\site-packages\django\utils\autoreload.py", line 262, in watched_files
yield from iter_all_python_module_files()
File "C:\Python37\lib\site-packages\django\utils\autoreload.py", line 103, in iter_all_python_module_files
return iter_modules_and_files(modules, frozenset(_error_files))
File "C:\Python37\lib\site-packages\django\utils\autoreload.py", line 139, in iter_modules_and_files
if not path.exists():
File "C:\Python37\lib\pathlib.py", line 1346, in exists
self.stat()
File "C:\Python37\lib\pathlib.py", line 1168, in stat
return self._accessor.stat(self)
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'C:\\Users\\Asus\\Desktop\\Fiverr\\vulunteer\\templates\\admin:admin\\base.html'
Process finished with exit code 1

Getting Error when starting my Django server

I wrote new models, made migrations, migrated the models but forgot to register the models in the admin.py file. After migrating I started my server and got the following error:
Watching for file changes with StatReloader
Performing system checks...
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\Bilawal Hassan\AppData\Local\Programs\Python\Python38\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Users\Bilawal Hassan\AppData\Local\Programs\Python\Python38\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\venv\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\venv\lib\site-packages\django\core\management\commands\runserver.py", line 117, in inner_run
self.check(display_num_errors=True)
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\venv\lib\site-packages\django\core\management\base.py", line 392, in check
all_issues = self._run_checks(
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\venv\lib\site-packages\django\core\management\base.py", line 382, in _run_checks
return checks.run_checks(**kwargs)
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\venv\lib\site-packages\django\core\checks\registry.py", line 72, in run_checks
new_errors = check(app_configs=app_configs)
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\venv\lib\site-packages\django\core\checks\urls.py", line 13, in check_url_config
return check_resolver(resolver)
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\venv\lib\site-packages\django\core\checks\urls.py", line 23, in check_resolver
return check_method()
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\venv\lib\site-packages\django\urls\resolvers.py", line 407, in check
for pattern in self.url_patterns:
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\venv\lib\site-packages\django\utils\functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\venv\lib\site-packages\django\urls\resolvers.py", line 588, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\venv\lib\site-packages\django\utils\functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\venv\lib\site-packages\django\urls\resolvers.py", line 581, in urlconf_module
return import_module(self.urlconf_name)
File "C:\Users\Bilawal Hassan\AppData\Local\Programs\Python\Python38\lib\importlib\__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 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\ecommerce\ecommerce\urls.py", line 27, in <module>
path('',include(('foodapp.urls', 'foodapp'), namespace='foodapp')),
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\venv\lib\site-packages\django\urls\conf.py", line 34, in include
urlconf_module = import_module(urlconf_module)
File "C:\Users\Bilawal Hassan\AppData\Local\Programs\Python\Python38\lib\importlib\__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 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 779, in exec_module
File "<frozen importlib._bootstrap_external>", line 916, in get_code
File "<frozen importlib._bootstrap_external>", line 846, in source_to_code
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ValueError: source code string cannot contain null bytes
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 "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\venv\lib\site-packages\django\core\management\__init__.py", line 401, in execute_from_command_line
utility.execute()
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\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\Bilawal Hassan\PycharmProjects\Ecommerce Website\venv\lib\site-packages\django\core\management\base.py", line 328, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\venv\lib\site-packages\django\core\management\commands\runserver.py", line 60, in execute
super().execute(*args, **options)
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\venv\lib\site-packages\django\core\management\base.py", line 369, in execute
output = self.handle(*args, **options)
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\venv\lib\site-packages\django\core\management\commands\runserver.py", line 95, in handle
self.run(**options)
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\venv\lib\site-packages\django\core\management\commands\runserver.py", line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\venv\lib\site-packages\django\utils\autoreload.py", line 599, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\venv\lib\site-packages\django\utils\autoreload.py", line 584, in start_django
reloader.run(django_main_thread)
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\venv\lib\site-packages\django\utils\autoreload.py", line 299, in run
self.run_loop()
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\venv\lib\site-packages\django\utils\autoreload.py", line 305, in run_loop
next(ticker)
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\venv\lib\site-packages\django\utils\autoreload.py", line 345, in tick
for filepath, mtime in self.snapshot_files():
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\venv\lib\site-packages\django\utils\autoreload.py", line 361, in snapshot_files
for file in self.watched_files():
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\venv\lib\site-packages\django\utils\autoreload.py", line 260, in watched_files
yield from iter_all_python_module_files()
File "C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\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\Bilawal Hassan\PycharmProjects\Ecommerce Website\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\Bilawal Hassan\AppData\Local\Programs\Python\Python38\lib\pathlib.py", line 1172, in resolve
s = self._flavour.resolve(self, strict=strict)
File "C:\Users\Bilawal Hassan\AppData\Local\Programs\Python\Python38\lib\pathlib.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>'
After getting this error I deleted my latest migration.py file but still getting the above exceptions while running my server.
Your issue is in the file C:\Users\Bilawal Hassan\PycharmProjects\Ecommerce Website\ecommerce\ecommerce\urls.py in line 27:
path('',include(('foodapp.urls', 'foodapp'), namespace='foodapp')),
Looks like Django can't find the foodapp app, check if the app is installed, you haven't any typo, etc
delete your database,then use command python manage.py showmigrations
if migrations are not made then use the migrate commands,otherwise delete both migration file and database file.then create migrations.py and include init.py in it.then run migration commands.it will fix.

Have received the following error while reusing movie app in my django project

I am using windows 10 python 3.7.3 and django 2.7.2 ,I am new to Django. Want to reuse the movie app "https://github.com/nathanborror/django-basic-apps/tree/master/basic " in my project.
Steps done before running the manage.py runserver:
1) Copied the folder in my django project directory
2) Have added the app in the Installed apps in Settings.py
3) Have updated the apps url in the urls.py file of my main django project
4) Have checked from the git repo page , no additional dependancy to be downloaded.
Error after running manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\threading.py", line 917, in _bootstrap_inner
self.run()
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\commands\runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 77, in raise_last_exception
raise _exception[0](_exception[1]).with_traceback(_exception[2])
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\apps\config.py", line 116, in create
mod = import_module(mod_path)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'pollsdjango-basic-apps-master'
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
utility.execute()
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\commands\runserver.py", line 60, in execute
super().execute(*args, **options)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\base.py", line 364, in execute
output = self.handle(*args, **options)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\commands\runserver.py", line 95, in handle
self.run(**options)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\commands\runserver.py", line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 577, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 562, in start_django
reloader.run(django_main_thread)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 280, in run
self.run_loop()
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 286, in run_loop
next(ticker)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 326, in tick
for filepath, mtime in self.snapshot_files():
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 342, in snapshot_files
for file in self.watched_files():
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 241, in watched_files
yield from iter_all_python_module_files()
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 103, in iter_all_python_module_files
return iter_modules_and_files(modules, frozenset(_error_files))
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 128, in iter_modules_and_files
if not path.exists():
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\pathlib.py", line 1339, in exists
self.stat()
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\pathlib.py", line 1161, in stat
return self._accessor.stat(self)
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<frozen importlib._bootstrap>'
Help will be very much appreciated.

Categories

Resources