diff --git a/config.py b/config.py new file mode 100644 index 0000000..d1c6e41 --- /dev/null +++ b/config.py @@ -0,0 +1,7 @@ +# database = ":memory:" +database = "dev.db" + +host = "localhost" +port = 8080 + +production = False diff --git a/main.py b/main.py index b3f6494..4bbab3c 100755 --- a/main.py +++ b/main.py @@ -3,13 +3,13 @@ import bottle from bottle.ext import sqlalchemy from sqlalchemy import create_engine +import config import database import routes import tools # Initialize db and include the SQLAlchemy plugin in bottle -# engine = create_engine('sqlite:///:memory:', echo=True) -engine = create_engine('sqlite:///dev.db', echo=True) +engine = create_engine('sqlite:///%s' % (config.database,), echo=True) app = bottle.Bottle() plugin = sqlalchemy.Plugin( @@ -59,4 +59,4 @@ app.route("/papers//relationships/", method="PATCH", if __name__ == "__main__": - app.run(host='localhost', port=8080, debug=True) + app.run(host=config.host, port=config.port, debug=(not config.production))