Badner
Badner

Reputation: 13

How to fix: "Unknow command: manage.py" in a Django project in PyCharm (newbie)

I'm totally new to Django, just learned a bit Python for science analysis. I use PyCharm as IDE wanted to made the django "tutorial" from the PyCharm website (https://www.jetbrains.com/help/pycharm/creating-and-running-your-first-django-project.html). I struggle quite early at the point "Launching Django Server". So, I can open the new command line with Ctrl+Alt+R, but when I enter "manage.py" as described in the tutorial I get the error "Unknown command: manage.py Type'manage.py help' for usage". If I type 'manage.py help' the same error occurs. Since PyCharm creates the files, the code itself should be functional since I didn't changed a single line. The versions are: PyCharm 2019.1.3 (Professional); Python: 3.7; Django: 2.2.3

I tried to run PyCharm as administrator. Since I'm totally new to Django I also have no idea what else I should try. A google search showed just findings not comparable to mine.

Upvotes: 0

Views: 1286

Answers (2)

Tom Weiss
Tom Weiss

Reputation: 124

In case this helps someone: had the same issue in pycharm even though it used to work using the same exact configuration. It worked when i tried to run "python3 manage.py runserver 127.0.0.1:8080" but not through pycharm. The accepted solution did not work.

The solution was to simply re-create the pycharm "Django Server" run configuration and delete the old one, seems like it was due to a pycharm version update. my current version is 2024.1.3.

Upvotes: 0

Daniel Roseman
Daniel Roseman

Reputation: 599490

That error is telling you that PyCharm is already supplying "manage.py" for you, so you are effectively doing "manage.py manage.py". Put in the command you want to run, on its own.

Upvotes: 1

Related Questions