Reputation: 1369
I've a python script using the Django framework running from a virtualenv, and I'd like to use the same script on a different machine where the virtualenv is located in a different place.
The script is like this:
#!/home/lenovo/.virtualenvs/gjt/bin/python
sys.path.append('/home/lenovo/prj/gjt/gjt')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'gjt.settings')
import django
django.setup()
To use the same script on a different machine, I'd need to change the shebangline to something else.
Thanks.
Upvotes: 0
Views: 156
Reputation: 26462
This shebang should be suitable for different vitual environments :
#!/usr/bin/env python
Upvotes: 2