Add A Blog Post Model and Form - Flask Fridays #17
12.2 هزار بار بازدید -
3 سال پیش
-
In this video I'll show
In this video I'll show you how to add a Blog Post Model to our Flask App with Python. We'll also create a Blog Post Form and a Webpage that we can use to add new Blog Posts to the app.
We've already got a User Model, now we need a Blog Post model to keep track of the actual posts for our Blog. We'll also need a Form for that model and a webpage to fill out the form on.
We'll look at all of those things in this video.
#flask #codemy #JohnElder
Timecodes
0:00 - Introduction
1:28 - Create Blog Post Model
5:08 - Make Migration And Push Migration
6:19 - Create PostForm
8:20 - Import TextArea WTForms Widget
8:45 - Create Post Page Route and Function
10:37 - Clear The Form On Submit
11:20 - Add Post To Database
11:45 - Create Flash Message On Submit
12:08 - Return Webpage
12:45 - Create Add_Post.html Webpage
14:43 - Add Link To Navbar
15:29 - Resize TextArea Size
15:42 - Conclusion
We've already got a User Model, now we need a Blog Post model to keep track of the actual posts for our Blog. We'll also need a Form for that model and a webpage to fill out the form on.
We'll look at all of those things in this video.
#flask #codemy #JohnElder
Timecodes
0:00 - Introduction
1:28 - Create Blog Post Model
5:08 - Make Migration And Push Migration
6:19 - Create PostForm
8:20 - Import TextArea WTForms Widget
8:45 - Create Post Page Route and Function
10:37 - Clear The Form On Submit
11:20 - Add Post To Database
11:45 - Create Flash Message On Submit
12:08 - Return Webpage
12:45 - Create Add_Post.html Webpage
14:43 - Add Link To Navbar
15:29 - Resize TextArea Size
15:42 - Conclusion
3 سال پیش
در تاریخ 1400/03/14 منتشر شده
است.
12,283
بـار بازدید شده