I've got a Django app that (for obscure reasons) needs to know the IP address of the server it's running on to present it back to the client. I can be pretty sure that the server will have eth0
up and running, so really, I need the address of eth0
.
What's the best way to get this? Ideally, this should be enumerated at uwsgi startup, and not necessarily every request. I thought about putting some code in settings.py
, but think that might get run/enumerated on every request.
edit I should add that this is a debian linux server, running nginx and running a Django application within uwsgi.