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

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?

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