I'm wondering if there any difference in using of following constructions? python manage.py [something] or ./manage.py [something]
Maybe there is preffered command for one statement like runserver and another for syncdb for example?
When invoking Python script via:
./script.py
.. it uses the Python interpreter defined in the script head. This should point to the Python interpreter defined in the environment, though sometimes (rarely) this might not be the case if the script author has not put in a proper head.
When invoking Python script via:
python script.py
... it uses Python interprefer from PATH
environment variable, usually pointing to the currently activated virtualenv. This is what you get if you run which python
command.
In most situations the Python interpreter should be the same.
You could also do:
/usr/bin/python script.py
... to force the usage of system-wide Python installation.
EDIT: Clarified the script head part.
There's no huge difference, except 2 things :
#!/usr/bin/python
at the top.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With