#!/usr/bin/python #coding: utf8 from flasky import app if __name__ == '__main__': app.run(debug = True, host = '0.0.0.0', port = 8080)
from flasky import app # Just grabs the app and runs it # Initialization done in __init__.py if __name__ == '__main__': app.run(debug=True)
from flasky.Models import User, Post from flasky import db, app db.drop_all() db.create_all() user1 = User(username="******", email="*****@*****.**", password="******") db.session.add(user1) user2 = User(username="******", email="*****@*****.**", password="******") db.session.add(user2) post1 = Post(title="first post", content=" the content", user_id=1) db.session.add(post1) db.session.commit() # app.run(host="0.0.0.0", port=5000, debug=True) # print(User.query.all()) # print(Post.query.all())
from flasky import app as application if __name__ == '__main__': application.debug = True application.run(host='0.0.0.0')
from flasky import app import os if __name__ == '__main__': # Bind to PORT if defined, otherwise default to 5000. port = int(os.environ.get('PORT', 5000)) app.debug = True app.run(host='0.0.0.0', port=port)
from flasky import app if __name__ == "__main__": app.run()