Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

support non localhost #40

Merged
merged 3 commits into from
Nov 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,3 @@ config.txt
# Vagrant
.vagrant

# Mac Finder
.DS_Store

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! This didn't belong here anyway :)

10 changes: 9 additions & 1 deletion manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,16 @@
WPTDASH_DB = CONFIG.get('postgresql', 'WPTDASH_DB')
WPTDASH_DB_USER = CONFIG.get('postgresql', 'WPTDASH_DB_USER')
WPTDASH_DB_PASS = CONFIG.get('postgresql', 'WPTDASH_DB_PASS')
WPTDASH_DB_URI = 'postgresql://%s:%s@localhost/%s' % (WPTDASH_DB_USER,
WPTDASH_DB_HOST = CONFIG.get('postgresql', 'WPTDASH_DB_HOST')

# This is here to not-break existing installations

if WPTDASH_DB_HOST == "":
WPTDASH_DB_HOST = "localhost"

WPTDASH_DB_URI = 'postgresql://%s:%s@%s/%s' % (WPTDASH_DB_USER,
WPTDASH_DB_PASS,
WPTDASH_DB_HOST,
WPTDASH_DB)

app = Flask(__name__)
Expand Down
8 changes: 7 additions & 1 deletion wptdash/prodapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@
WPTDASH_DB = CONFIG.get('postgresql', 'WPTDASH_DB')
WPTDASH_DB_USER = CONFIG.get('postgresql', 'WPTDASH_DB_USER')
WPTDASH_DB_PASS = CONFIG.get('postgresql', 'WPTDASH_DB_PASS')
WPTDASH_DB_URI = 'postgresql://%s:%s@localhost/%s' % (WPTDASH_DB_USER,
WPTDASH_DB_HOST = CONFIG.get('postgresql', 'WPTDASH_DB_HOST')

if WPTDASH_DB_HOST == "":
WPTDASH_DB_HOST = "localhost"

WPTDASH_DB_URI = 'postgresql://%s:%s@%s/%s' % (WPTDASH_DB_USER,
WPTDASH_DB_PASS,
WPTDASH_DB_HOST,
WPTDASH_DB)

prod_app = create_app(dict(
Expand Down