Closed vkurup closed 9 years ago
I'm uneasy about having importing load_env.py
have side effects like that (even though Celery does it all over the place).
Sounds good. How would you prefer that I do it then?
Oops... I was thinking about something completely different, sorry. I'll revert the load_env.py change.
How about this version? If OK, any suggestions for naming? load_env.load_env()
isn't the greatest.
Looking again at django-dotenv (https://github.com/jpadilla/django-dotenv), I wonder if we even need our own load_env.py
. It looks like it can find .env
by itself:
import dotenv
dotenv.read_dotenv()
I thought that too, but when I tried it (installing gunicorn and django in a virtual env and then running gunicorn project.wsgi:application
, it didn't find the .env
properly.
This issue suggests the same thing: https://github.com/jpadilla/django-dotenv/issues/14
Oh well. I don't have any great inspirations around naming either. Maybe I should have gone to that DjangoCon talk on naming...
:+1:
Ooh... that's a talk I'll need to track down.
I also moved the dotenv setup to a common module to reduce duplication.
Closes #206