R
R
Ronig2021-07-25 20:41:46
Django
Ronig, 2021-07-25 20:41:46

Can't start server via python manage.py runserver, how?

Just started working with Django, everything worked fine until
python manage.py runserver
I type this into the console while in the right directory and this is what it gives me

C:\Django\trt>python manage.py runserver
Traceback (most recent call last):
  File "C:\Django\trt\manage.py", line 22, in <module>
    main()
  File "C:\Django\trt\manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "C:\Python39\lib\site-packages\django\core\management\__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "C:\Python39\lib\site-packages\django\core\management\__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Python39\lib\site-packages\django\core\management\base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "C:\Python39\lib\site-packages\django\core\management\commands\runserver.py", line 61, in execute
    super().execute(*args, **options)
  File "C:\Python39\lib\site-packages\django\core\management\base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "C:\Python39\lib\site-packages\django\core\management\commands\runserver.py", line 96, in handle
    self.run(**options)
  File "C:\Python39\lib\site-packages\django\core\management\commands\runserver.py", line 103, in run
    autoreload.run_with_reloader(self.inner_run, **options)
  File "C:\Python39\lib\site-packages\django\utils\autoreload.py", line 640, in run_with_reloader
    exit_code = restart_with_reloader()
  File "C:\Python39\lib\site-packages\django\utils\autoreload.py", line 259, in restart_with_reloader
    p = subprocess.run(args, env=new_environ, close_fds=False)
  File "C:\Python39\lib\site-packages\run\__init__.py", line 145, in __new__
    process = cls.create_process(command, stdin, cwd=cwd, env=env, shell=shell)
  File "C:\Python39\lib\site-packages\run\__init__.py", line 121, in create_process
    shlex.split(command),
  File "C:\Python39\lib\shlex.py", line 315, in split
    return list(lex)
  File "C:\Python39\lib\shlex.py", line 300, in __next__
    token = self.get_token()
  File "C:\Python39\lib\shlex.py", line 109, in get_token
    raw = self.read_token()
  File "C:\Python39\lib\shlex.py", line 140, in read_token
    nextchar = self.instream.read(1)
AttributeError: 'list' object has no attribute 'read'

Everything is standard in the files, I did not change anything

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ronig, 2021-07-29
@Mnhcxjd

The error was that I had several versions of python, I had to delete everything and reinstall it

A
Alexander Nesterov, 2021-07-26
@AlexNest

Well, as if everything is written in the trace:

AttributeError: 'list' object has no attribute 'read'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question