Thank you for the reply. I'm trying to avoid storing my actual password in more files that are needed, is it possible to make my flask application have access to the environmental variable without my having to store the actual value in the uwsgi config?

For example, can I just tell UWSGI what var I want to export without specifying the value, or perhaps, does UWSGI not even need to export the variable, the application can just read it anyway?
-------- Original Message --------
Subject: Re: [uWSGI] Environmental variable in UWSGI
From: Łukasz_Mierzwa <[email protected]>
Date: Tue, March 18, 2014 4:26 pm
To: uWSGI developers and users list <[email protected]>

My server:
> export myvar=test

It depends where have you set this, is it sources by uWSGI init script? You can check if uWSGI workers have this variable in environment by reading /proc/:pid/environ.

You can instruct uWSGI to set any env variables for you, using --env option. So yes, "env = key=value" in uWSGI ini file will work.
I would suggest to do it this way, it's easier to maintain your app this way.



2014-03-19 0:13 GMT+01:00 <[email protected]>:
  Hi,

I am a bit new to this but learning. I want to a password as an environmental variable and then use this variable in my flask application. I have the code for flask to read the environmental variable but it doesnt seem to be able to get it. 

My server:
export myvar=test

My application:
app.config.from_envvar('myvar')

However, is there something else I have to do with UWSGI? For example, do I need to do something like this so my app can access the env var because it can't seem to see it at the moment.

env = myvar=test


_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi




--
Łukasz Mierzwa

_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to