caktus / django-project-template

Django project template for startproject (Requires 2.2+)
209 stars 53 forks source link

Add docs on setting up celery with dotenv #208

Closed vkurup closed 9 years ago

vkurup commented 9 years ago

I also moved the dotenv setup to a common module to reduce duplication.

Closes #206

dpoirier commented 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).

vkurup commented 9 years ago

Sounds good. How would you prefer that I do it then?

vkurup commented 9 years ago

Oops... I was thinking about something completely different, sorry. I'll revert the load_env.py change.

vkurup commented 9 years ago

How about this version? If OK, any suggestions for naming? load_env.load_env() isn't the greatest.

dpoirier commented 9 years ago

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()
vkurup commented 9 years ago

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

dpoirier commented 9 years ago

Oh well. I don't have any great inspirations around naming either. Maybe I should have gone to that DjangoCon talk on naming...

:+1:

vkurup commented 9 years ago

Ooh... that's a talk I'll need to track down.