Discussion:
Advice on the correct use of shebang for the django framework run under a virtualenv
Bundupress
2018-11-13 17:21:26 UTC
Permalink
I recently started using Python and Django and was wondering if I can get
some advice on the correct use of shebang?

So I setup a new django project on a hosted server that has a Python
Virtualenv. When the env is activated the python path points to the env and
when deactivated the path points to /usr/bin/python.

*My question is, *do I need to add the correct shebang path to all my .py
files ie urls.py, views,py etc *#! /home/user/pyenv python* to set the
correct python path to virtualenv or is there a better, best practice
method that should be following?
--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Clara Daia
2018-11-13 17:50:13 UTC
Permalink
I believe you do not need the shebang as you will not, in general, be
executing any of these files as independent scripts. You just need to make
sure `manage.py` is executed with the correct python path.
Post by Bundupress
I recently started using Python and Django and was wondering if I can get
some advice on the correct use of shebang?
So I setup a new django project on a hosted server that has a Python
Virtualenv. When the env is activated the python path points to the env and
when deactivated the path points to /usr/bin/python.
*My question is, *do I need to add the correct shebang path to all my .py
files ie urls.py, views,py etc *#! /home/user/pyenv python* to set the
correct python path to virtualenv or is there a better, best practice
method that should be following?
--
You received this message because you are subscribed to the Google Groups
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...