Adding a CMS to Your Flask Web App Transcripts
Chapter: The pages (our WordPress)
Lecture: Admin page listings

Login or purchase this course to watch this video and the rest of the course contents.
0:00 what we've had the ability to list redirects in Because that's so similar listing pages, you can bet we're probably gonna fly through this.
0:09 All right, so let's just clone this over here and make this pages and this will be pages. It's all looking good now.
0:17 One thing. I just want to make really quick pointers I had previously when I wrote thes put it like this and the combination of the blueprints,
0:26 the response decorator and this don't work in that order. So I had to switch. It's the blueprint has to appear first.
0:32 I don't think it really matters which of those two pure next. But if you're following along, but not copying what we've done here,
0:39 go ahead and make sure just test this admin stuff works when you're not logged in and put it second, Put the blueprints first,
0:46 basically. Okay, so let's go work on these pages. We need a page is a list of your model and let's go over a view model or admin. Make a copy,
1:00 as we're apt to do, call its pages, maybe make this pages and this We've already written this function all pages. Well, that was easy We're good.
1:14 Good with this one. Now, we could have kind of, like, combined these and be a little bit slower, but it's admin educators. I'm OK with having to write.
1:21 So we're gonna have this. We gotta import it. I didn't change the name tonight. Just the file name, not the class name pages.
1:31 There we go. Now. We could import that at the top. It's close to working. Oh, be careful. Careful. This actually won't run.
1:37 I don't think we try to run it. Yeah. Says the view functions overriding existing one. But that's because this is redirects.
1:45 And this needs to be pages. Hey, we should be close just to get a missing template. Errors. We go over to admin.
1:54 It used to be a 44 Now we just have admin pages. So let's go out that real quick, and we should be in business.
2:01 Like I said, there's just mimic her mirror what we did over in the redirects or the pages. So read rex pages and this will be pages.
2:12 Basically, we just got to go through and see where we talk about redirects and change it to pages, but it's really,
2:16 really similar fact at home is good. This will be at a page. This doesn't exist yet, but it's going to go. And this will be peon pages.
2:28 Let's see what we got going on here sort of test was Just call it visit or view called View, and it's be your URL for the page and then over
2:41 here and edit. It is fine. So let's say and it page again. This doesn't exist. What's going, Teoh? That's fine. We don't need or even have a name.
2:51 And then for this we just want to set this to be p dot title. All right? Unless I missed, something here. It's so far is looking good.
3:03 I think they should work Ready, See if we can lister pages. Oh, sweet. Look at that. All right, so here they all are and we go back and go down again
3:11 We've got a redirects. Here's our reader X and our pages now work. This will be a for four. We haven't done that yet. We're going to shortly.
3:19 Same with edit. Just like with the redirects. Add a new one and edit is almost identical. But view that should work. Can we do it.
3:27 Boom company history. Fantastic our team and donate to the pierce off Samos clicking right there. All right, well,
3:35 those are the three pages in our site, and we can list them and view them. And we're on the precipice, the edge of being able to edit them.
3:42 But no, we can't quite edit him, because that's one more thing we gotta right, but yeah, this was the next step in adding page building,
3:49 edit and create pages in our CMS.


Talk Python's Mastodon Michael Kennedy's Mastodon