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

17👍

manage.py should live in the root project folder, so if you cd into C:Users/arpchauh/PycharmProjects/post_blog, you should be able to run the command.

👤yanxun

4👍

Your manage.py file should be located in the root directory of the project. You need to be in the directory that manage.py is in.

2👍

One error that might be leading to this is entering

django-admin startapp app_name

instead of

django-admin startproject project_name

1👍

Once you start the django application

django-admin startporject my_project_name

you need to navigate inside the my_project_name folder and then launch

python manage.py runserver

If you are still getting some error, do check where is your python interpreter taking the django setup from

0👍

The manage.py file must be available at the root of the project folder. If it is in any sub-directory, it’ll give you error.
If you are limited to keeping the file in the sub-directory, you can change the permission of folder, so the python cli can read it.

0👍

Your manage.py file should be located in the root directory of the project. You need to be in the directory that manage.py is in and then run the server
python manage.py runserver

0👍

your "manage.py" file is in the "post_blog" folder and you are giving a command in the following directory
C:Users/arpchauh/PycharmProjects/post_blog/blogs>

if you focus there is no manage.py file in the blogs folder that why its creating an issue

Use this one, I hope it will resolve your issue

C:Users/arpchauh/PycharmProjects/post_blog> python manage.py runserver

-1👍

It’s very simple. You are not inside the project root folder (you are in your blog app folder). make sure you change the directory to the project folder and run those commands.
use cd command to change directory

cd C:Users/arpchauh/PycharmProjects/post_blog
// or move one step backword
cd ..

-2👍

Refer to my project path C:\Users\sharpfungs\Desktop\django\djangosite to match with yours.
Make sure your virtualenv is active as (myproject) C:> for windows.
Then run run the server in the root of project folder.

👤Ones

Leave a comment