# ----------------------------------------------------------------------------------------- # # Program: My Python Blog # # Author: Hasan Abdulhamid # # Description: Personal blog about learning and building with Python. # Features user registration, profiles and posting. # # File: run.py - This is the main file for My Python Blog # # ----------------------------------------------------------------------------------------- from pyblog import app if __name__ == '__main__': app.run(debug=True)
################################################# ####### ####### ####### MAIN.PY ####### ####### ####### ################################################# import sys print("exe:",sys.executable) from pyblog import app if __name__ == "__main__": app.run()
from pyblog import app as pyblog_app from pyblog import models, db, forms import flask @pyblog_app.shell_context_processor def make_shell_context(): return { 'app': pyblog_app, 'models': models, 'db': db, 'forms': forms, 'flask': flask } if __name__ == "__main__": pyblog_app.run(debug=True, port=5000)
################################################# ####### ####### ####### MAIN.PY ####### ####### ####### ################################################# from pyblog import models, forms, routes from pyblog import app, db @app.shell_context_processor def shell_context(): return { 'models': models, 'app': app, 'db': db, 'forms': forms, 'routes': routes, 'myname': 'eyal' } if __name__ == "__main__": app.run(host='0.0.0.0', port=5000)