Last active
August 29, 2015 13:57
-
-
Save einyx/6025f7307ff302021b9d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(redash)alessiog@ip-10-2-2-76:/opt/redash/redash$ cat redash/settings.py | |
import json | |
import os | |
import urlparse | |
def parse_db_url(url): | |
url_parts = urlparse.urlparse(url) | |
connection = { | |
'engine': 'peewee.PostgresqlDatabase', | |
'name': "redash", | |
'password': "test", | |
'host': "somehost.com | |
'port': 5432, | |
} | |
# if url_parts.hostname and not url_parts.path: | |
# connection['name'] = url_parts.hostname | |
# else: | |
# connection['name'] = url_parts.path[1:] | |
# connection['host'] = url_parts.hostname | |
# connection['port'] = url_parts.port | |
# connection['user'] = url_parts.username | |
# connection['password'] = url_parts.password | |
return connection |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment