-1

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

pls help.

davidism
  • 121,510
  • 29
  • 395
  • 339
luscus
  • 17
  • 3

1 Answers1

3

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.

For more info on configuring the env file in gunicorn service, you can see here.

N SURYA
  • 81
  • 3