Display random entries from a database Python 3


show more Displaying random entries from a database provides you with in-depth training on Developer. Taught by Bill Weinman as part of the Python 3 Essential Training show less
please wait ...

Displaying random entries from a database

Here we have a simple database application that displays a list of random testimonials or quotes on a web page. If you look at my web page, I actually used this for testimonials. And every time the page gets reloaded, it pulls up three different quotes from the database at random. The database itself is managed with this application that allows you to go through and add, edit and delete entries in the database. We'll look at that in a separate movie in this chapter. In this chapter, we're going to look at how this application works ,which retrieves the quotes from the database and displays them at random.

So in the Projects folder, in your Exercise Files, in the testimonials folder and you'll find testimonials.py. And this is actually exactly the same script that is on my web site. This is the script that reads the quotes from the database and displays a number of them at random. It's a very short script. It's just 73 lines long, including the white space and comments a...

Displaying random entries from a database
Video duration: 5m 8s 6h 36m Beginner

Viewers:

Displaying random entries from a database provides you with in-depth training on Developer. Taught by Bill Weinman as part of the Python 3 Essential Training

Subjects:
Developer Web
Software:
Python
Author:
please wait ...