Adding a CMS to Your Pyramid Web App Transcripts
Chapter: The Pages
Lecture: Difference between CMS vs data-driven pages
0:00 Well, I'm pretty excited because we've come to the chapter where we really get to focus on
0:06 what you probably consider as the core feature of a CMS, or content management system. that we're plugging into our Web app here.
0:13 But what are we talking about with these CMS pages? Probably the best way to understand it is to compare them to traditional data-driven pages.
0:21 And I will just look at an example, and then I'll make sense of these two for you if If you're not sure what I'm talking about.
0:26 Here's one page from our website. We can go and dig into the details about a package.
0:31 This one is the AWS CLI, the Amazon Web Services command line interface. Here's another one where we're getting help.
0:40 We haven't created this one yet, but we're going to create this one pretty much as-is.
0:43 This what you would get if you click that help link in the top of the navigation?
0:48 At first glance, they look kind of the same, right? They have the same shell. The CSS style is definitely the same.
0:55 Things like that. However, they're very, very different. One on the left is a data driven page.
0:59 and what I mean by that is in the database, there are multiple entries or models that have certain pieces of information.
1:05 and the job of this page is to, in a very structured way, pull out the specific version of that model from the database.
1:12 So, in this case, pull out the AWS CLIs settings and fill them in all over the place.
1:18 Like right here We have the name of the package and the current version that's shown on this page, and we have the command to install that package.
1:27 Here we have whether or not it's the latest version? And when that version was released.
1:30 So we pulled the package details from the database and a list or collection of releases from the database. We also have the summary of the package.
1:40 Here we have a bunch of links that will take you say over the project description or the release history
1:46 Or where you can download files from this all has to do with this particular package.
1:51 There's links at the bottom like you can barely barely see homepage down there.
1:55 That's of course, set in the database. And there's the description as well.
1:59 Everything about this is just, I'm gonna have exactly this structure, but vary by the piece of data that we're getting back.
2:07 A good example to think about this also might be Amazon, right? Like I'm looking at a book that looks the same for every single book.
2:14 It just happens to have different details filled in. On the right. The CMS page is very different. It's probably stored in the database technically,
2:23 but for all purposes, it's just a blob of text that's dropped on the page
2:27 This "Hello", this "help with PyPI", "do you need help installing the package?".
2:31 That whole section, there's no structure. It is, here is the text boom. Whatever they typed in its that.
2:37 This is great for landing pages, for these help pages, for other parts where people just need to write informational stuff on the Web.
2:43 But it's not exactly structured with a whole bunch of different things coming out of the database like this one on the left is.
2:43 So you might ask, Why do I need to put that in the database? I could just create static files. I could go and create markdown.
2:56 There's even whole things like Pelican, that will actually go and from a bunch of static files generate these Web pages.
3:03 That would look like the thing here on the right. Well, that works for the core bit. But there's also other dynamic things.
3:09 Notice we still have the fact that you're logged in or you're not logged in, whether or not you're an admin.
3:14 There's a lot of stuff going on that still needs the smarts, needs the behavior of our data driven Web app.
3:20 It's just this page. Why do we need to go write source code to create it?
3:25 We don't. We should be able to just log into an admin section, type some stuff out, and now we have a help page on our website.
3:30 So that's what we're gonna focus on in this chapter. Building the thing on the right.
3:35 Basically, the white part of the right page. It should be a lot of fun.