cuizin/cuizin/__main__.py

25 lines
479 B
Python
Raw Normal View History

2018-03-01 17:57:45 +01:00
"""
Main entry point for Cuizin.
"""
import os
2018-02-27 17:47:32 +01:00
import peewee
from cuizin import db
from cuizin import web
app = application = web.app
if __name__ == '__main__':
HOST = os.environ.get('CUIZIN_HOST', 'localhost')
PORT = os.environ.get('CUIZIN_PORT', '8080')
2018-03-01 17:57:45 +01:00
DEBUG = bool(os.environ.get('CUIZIN_DEBUG', False))
2018-02-27 17:47:32 +01:00
try:
db.database.create_tables([db.Recipe])
except peewee.OperationalError:
pass
app.run(host=HOST, port=PORT, debug=DEBUG)