Glam Prestige Journal

Bright entertainment trends with youth appeal.

I'm using Celery alongside Django, and because I'm running into This Problem (Gunicorn not having access to OS environment variables) I've had to set EnvironmentFile=/etc/environment within my gunicorn.service file to access things like DJANGO_SECRET_KEY etc.

This works perfectly, no issues.

However when trying to get Celery setup, it's running into the same problem. My struggle is that celery already makes use of EnvironmentFile=/etc/conf.d/celery and I'd sort of like to keep my gunicorn and celery environment files separate...

I tried EnvironmentFile=/etc/environment /etc/conf.d/celery but of course this "Failed to load environment files"

Is it possible to load multiple environment files?
Or have one environment file "call" another"?
Or to simply load all environment files in a particular directory?

3

1 Answer

looks like according to

EnvironmentFile= ...may be specified more than once in which case all specified files are read.

So all I needed was

EnvironmentFile=/etc/environment
EnvironmentFile=/etc/conf.d/celery

Thanks to @steeldriver for the help!

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy