[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: In python app, how to get DB environment variable?



Here is an example of what I use

https://github.com/thesteve0/openshift-mongo-flask-example/blob/master/wsgi/myflaskapp.py


From: "Zilu Yuan" <yuanlukeyuan gmail com>
To: users lists openshift redhat com
Sent: Thursday, March 6, 2014 10:27:27 PM
Subject: In python app, how to get DB environment variable?


Hi,
the problem I suffer both in Openshift Online and in Openshift Origin

I create a python application, django or raw python. Then I create DB such as MySQL or Mongo.

And then I want to get the DB environment variable.

So I write some code like "os.environ.get("OPENSHIFT_MYSQL_DB_USERNAME")" or "os.environ["OPENSHIFT_MYSQL_DB_USERNAME"]" in views.py(dajngo) or application(raw python). It not work.

How can I do it?

_______________________________________________
users mailing list
users lists openshift redhat com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]