Skip to content

BrosCoffee/Flask_Blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Origin

  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.

Details

run.py:

  • type python run.py in the terminal to initiate the website
  • if __name__ == '__main__':
            app.run(debug=True)

flaskblog/ :

init.py:

  • call the app = Flask(__name__)
  • database db = SQLAlchemy(app)
  • bcrypt bcrypt = Bcrypt(app)
  • login manager login_manager = LoginManager(app)
  • then call routes.py

routes.py:

  • manage all the routes (website pages)
forms.py:
  • import FlaskForm, fields, and validators
  • Two objects: "RegisterForm" and "LoginForm"
models.py:
  • import db and write into the database
  • two objects: "User" and "Post"

templates/ :

home.html
  • {% ... %} for python syntax
  • {{ ... }} for variables
  • layout.html
  • Using bootstrap as the layout model for the website
post.html
  • Bootstrap Modal: search for "Live demo"
  • etc.

static/ :

main.css
  • The main css model
Learning resource: Corey Schafer
(Last updated date: Aug. 16th 2019)

About

Using the Flask framework to build a personal blog.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors