I have created a Django project "post_blog" in which I have created an app "blogs".
C:Users/arpchauh/PycharmProjects/post_blog/blogs>python manage.py runserver
python: can't open file 'manage.py': [Errno 2] No such file or directory
I have created a Django project "post_blog" in which I have created an app "blogs".
C:Users/arpchauh/PycharmProjects/post_blog/blogs>python manage.py runserver
python: can't open file 'manage.py': [Errno 2] No such file or directory
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.
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.
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
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.
One error that might be leading to this is entering
django-admin startapp app_name
instead of
django-admin startproject project_name
You're not in the proper directory...In the case you described, you should have:
mkdir newproject (not sure why you're doing this...but we'll continue with it)
cd newproject django-admin.py startproject newproject
cd newproject ← A key missing part from what you did. You need to change into the directory where manage.py resides. Verify it by using ls at the command prompt after switching into the directory.
python manage.py runserver
Use ls often, if you need, to double check where you are in the directory tree.
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
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
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 ..
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.