0

I can't run my Django project, can you help?

While py can run any py file in the terminal as py_any_project_name.py, when I type py manage.py runserver or python manage.py runserver, I get python not found error. Any ideas on the cause and solution? I'm using Python 3.10 and it's attached to the environment variables as the path..

For example i create an example.py file that includes print("Example").

py example.py

Example

py manage.py runserver

Python can not found.

  • 1
    What is the actual error (copy and paste it here)? are you in the same folder as `manage.py` when you run this? – AMG May 31 '22 at 12:20

2 Answers2

0

You need to enter that file path to run it, or just paste the file path of the python file. I hope I was able to help!

That Guy
  • 1
  • 1
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 31 '22 at 12:58
  • Welcome to Stack Overflow, see how do I write a good answer [answer]. – Sunderam Dubey May 31 '22 at 13:08
0

You can actually run administrative django commands without a manage.py script, which you might be lacking. Make sure your environment variables are correctly setup (DJANGO_SETTINGS_MODULE and whatnot) and django is installed in your python environment and try to run

python -m django runserver
N1ngu
  • 2,862
  • 17
  • 35