Skip to content

Commit

Permalink
appConfig: Use config.py file for database uri config.
Browse files Browse the repository at this point in the history
  • Loading branch information
kx-chen committed Dec 20, 2017
1 parent 11d36d5 commit d4eae25
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion lostfound/appConfig/appFactory.py
@@ -1,17 +1,20 @@
from flask import Flask
from .dbClient import db

import os

from lostfound.public import public_views
from lostfound.users import user_views
from lostfound.items import item_views
from flask_sqlalchemy import SQLAlchemy
from lostfound import config

def create_app(cfg=None):
app = Flask('lostfound')


app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgres://vxtsfazasjzswx:343e88d24e1d42804c275bcfc1dc9b58cc294ce0c47870bac43a25ca87fe8ca1@ec2-54-221-196-253.compute-1.amazonaws.com:5432/d8l24k56ov6qsv'
app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get('DATABASE_URL', config.SQLALCHEMY_DATABASE_URI)
app.secret_key = 'A0Zr98j/3yX R~XHH!jmN]LWX/,?RT'

# db.app = app
Expand Down
2 changes: 1 addition & 1 deletion lostfound/config.py
@@ -1,6 +1,6 @@
SECRET_KEY = 'A0Zr98j/3yX R~XHH!jmN]LWX/,?RT'

SQLALCHEMY_DATABASE_URI = 'postgresql://postgres:opensesame@localhost/postgres'
SQLALCHEMY_DATABASE_URI = 'postgresql://kai:opensesame@localhost:5432/postgres'

# psql -h localhost -U kai postgres
# heroku pg:psql postgresql-animated-12554 --app lostfoundapp
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Expand Up @@ -2,8 +2,8 @@

Helping you find lost items.

[![Build Status](https://travis-ci.org/KaiUsesThis/lost-found.svg?branch=master)](https://travis-ci.org/KaiUsesThis/lost-found)
[![Coverage Status](https://coveralls.io/repos/github/KaiUsesThis/lost-found/badge.svg)](https://coveralls.io/github/KaiUsesThis/lost-found)
[![Build Status](https://travis-ci.org/kx-chen/lost-found.svg?branch=master)](https://travis-ci.org/kx-chen/lost-found)
[![Coverage Status](https://coveralls.io/repos/github/kx-chen/lost-found/badge.svg)](https://coveralls.io/github/kx-chen/lost-found)

## To run:
```
Expand Down

0 comments on commit d4eae25

Please sign in to comment.