Reputation: 1010
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
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
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