29👍
Here is the answer from uWSGI developers:
just place each of them (one per line) in a text file in the form
VAR=VALUE
then in uWSGI config
[uwsgi] for-readline = yourfile env = %(_) endfor =
This also works with yml config files:
for-readline: filename
env: %(_)
endfor:
2👍
I use django-dotenv. Put your env vars in a file like .env inside your project, and then load it in manage.py and wsgi.py. No other config required. uwsgi and manage.py commands will work as expected, and all your env vars are stored in just one file.
1👍
- Django update on queryset to change ID of ForeignKey
- How can I insert parameters in raw SQL in Django Python
- Spurious newlines added in Django management commands
- RuntimeError: 'list' must be None or a list, not <class 'str'> while trying to start celery worker
Source:stackexchange.com