Django ./manage.py
I was wondering how to set up a configuration file on my computer so that when I want to run manage开发者_JS百科.py for my django project I would be able to run "./manage.py" as opposed to "python manage.py".
Thanks.
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.)
chmod +x manage.py
should do it
On Linux/OSX, I:
sudo chmod 777 ./manage.py
After that, I can run it without specifying python. Hope that helps you out.
精彩评论