Home > database >  I cant run the server in my project with django
I cant run the server in my project with django

Time:11-06

I created a project in django normally, but when I try to run the server (python manager.py runserver) I get the following error: C:\Users\Fredy\AppData\Local\Programs\Python\Python39\python.exe: can't open file 'C:\Downloads\django_one\manager.py': [Errno 2] No such file or directory

The strange thing is that the manager.py file is there. I went back to other projects that I had already created that were working and the same error occurred. Does anyone know how I fix this?

error image

CodePudding user response:

use "python manage.py runserver". If you look at the files, it has a "manage.py" and not "manager.py"

CodePudding user response:

Usually this happens because you are not in the root directory of the project. Judging by the screenshot it looks like you are, but worth a double check.

There are a few possible solutions:

  1. chmod x manage.py (manage.py may have lost execute permissions)
  2. Did you forget to activate the virtual environment?
  3. Your installation of Django may not support Python 3.9 (Django 3.2 supports Python versions 3.6, 3.7, 3.8, 3.9, 3.10)

Some sources to look into:

python: can't open file 'manage.py': [Errno 2] No such file or directory

https://www.pythonanywhere.com/forums/topic/756/

https://docs.djangoproject.com/en/3.2/ref/django-admin/

https://docs.djangoproject.com/en/3.2/faq/install/

I hope this gives some direction. Good Luck

  • Related