I want to ensure that os.environ
and sys.path
are identical for all ways we start the Python interpreter:
- web requests via Django, and Apache mod_wsgi
- Cron jobs
- Interactive logins via ssh
- Celery jobs
- Jobs started via systemd
Is there a common way to solve this?
If yes, great: How does it look like?
If no, sad: Everybody solves this on his own. ... What is a good way to solve this?
Operating System: Linux (with systemd support)
Update
More explicit:
- I want
sys.path
to be the same in web requests, cron jobs, python started from shell, ... - I want
os.environ
to be the same in web requests, cron jobs, python started from shell, ...
Update2
For systemd we use EnvironmentFile
Update3
We use virtualenv
os.environ
andsys.path
is equal for web-requests, cron, daemons started by systemd, shell, .....? – Loadstar