Etan
Etan

Reputation: 1010

Django ./manage.py

I was wondering how to set up a configuration file on my computer so that when I want to run manage.py for my django project I would be able to run "./manage.py" as opposed to "python manage.py".

Thanks.

Upvotes: 4

Views: 3566

Answers (3)

Chris Morgan
Chris Morgan

Reputation: 90742

If you're on Windows, you can already provided the file extension registration is correct (invoking python.exe rather than pythonw.exe, I mean, or you won't see the console output and it won't wait for it to finish).

On other operating systems, make manage.py executable with chmod +x manage.py and then you can do ./manage.py. It should have the #!/usr/bin/env python hashbang already which tells it what program to run it with.

(This applies to everything, not just manage.py - read about the shebang (Wikipedia) for more info.)

Upvotes: 16

Brandon Taylor
Brandon Taylor

Reputation: 34553

On Linux/OSX, I:

sudo chmod 777 ./manage.py

After that, I can run it without specifying python. Hope that helps you out.

Upvotes: 0

Uku Loskit
Uku Loskit

Reputation: 42040

chmod +x manage.py

should do it

Upvotes: 7

Related Questions