So I am experimenting with uWSGI and liking it a lot.
I have a question regarding the use of its .ini file though.
Is it possible to calculate values for its .ini configuration parameter dynamically?
For instance, for the "chdir" value in my "uwsgi.ini" file, I have
[uwsgi]
socket=127.0.0.1:3034
chdir=/Users/calvin/work/myproject
virtualenv=/Users/calvin/.virtualenvs/myproject
module=django.core.handlers.wsgi:WSGIHandler()
env= DJANGO_SETTINGS_MODULE=myproject.settings
master=True
pidfile=/tmp/myproject-master.pid
vacuum=True
max-requests=5000
daemonize=/var/log/uwsgi/myproject.log
It's quite a bother to have to write 3 separate .ini files for my "local machine", my "development/staging" server and my "production server". Not to mention that a colleague's local machine's chdir
value will be completely different.
I tried using import os
and os.join.path
to compute the chdir
value dynamically but it doesn't work, which is to be expected since uwsgi does not have a python interpretor?