Skip to content

Commit

Permalink
this app will also connects oss, and change docker image name
Browse files Browse the repository at this point in the history
  • Loading branch information
zzxwill committed Jan 11, 2021
1 parent ea88b7f commit de10ccb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# database-flask-web-application
A Python Flask web application which will connect to a database (Mysql/PostgreSQL), which be used in OAM/KubeVela
A Python Flask web application which will connect to a database (Mysql/PostgreSQL/OSS), which be used in OAM/KubeVela

Source code of image `zzxwill/database-flask-web-application` locates here.
Source code of image `zzxwill/flask-web-application` locates here.
9 changes: 7 additions & 2 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@
</head>
<body>

<div style="text-align:center">
<h1> I am running up!</h1>
<h1> I'm running up!</h1>
<br />
<div>The database information I received is as below.</div>
<br />
<div>1) DB host: {{ host }}</div>
<div>2) DB user: {{ user }}</div>
<div>3) DB password: It's a secret and I won't let you know :)</div>
<br /><br />
<div>The oss information I received is as below.</div>
<br />
<div>1) OSS bucket name: {{ oss_bucket_name }}</div>
</div>


Expand Down
2 changes: 2 additions & 0 deletions wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
user = os.getenv("DB_USER")
password = os.getenv("DB_PASSWORD")

oss_bucket_name = os.getenv("BUCKET_NAME")

if not (host and user and password):
print('Could NOT retrieve DB information from environment variables. Exiting...')
sys.exit(-1)
Expand Down

0 comments on commit de10ccb

Please sign in to comment.