I am trying to deploy python app in my centos7 using flask and gunicorn. but i found that the app is not able to retrive variables from .env file.
It is working on my local vm. I am using gunicorn --bind 0.0.0.0:5000 app:app
gunicorn --bind 0.0.0.0:5000 app:app
pls help.
So, just configure a service file app.service in /etc/systemd/system and add EnvironmentFile=/path_to_env_file under [service] and start the service.
/etc/systemd/system
EnvironmentFile=/path_to_env_file
[service]
For more info on configuring the env file in gunicorn service, you can see here.