The project is using Python and the Flask framework to create a personal blog. The main focus is to understand the HTTP protocol, the interaction between the website and its database, and the deployment of the application. Thus, I simply implemented the Bootstrap as the front-end framework.
- type
python run.pyin the terminal to initiate the website if __name__ == '__main__':
app.run(debug=True)
- call the
app = Flask(__name__)- database
db = SQLAlchemy(app)- bcrypt
bcrypt = Bcrypt(app)- login manager
login_manager = LoginManager(app)- then call routes.py
- manage all the routes (website pages)
- import FlaskForm, fields, and validators
- Two objects: "RegisterForm" and "LoginForm"
- import db and write into the database
- two objects: "User" and "Post"
{% ... %}for python syntax{{ ... }}for variables- layout.html
- Using bootstrap as the layout model for the website
- Bootstrap Modal: search for "Live demo"
- etc.
- The main css model