Up and Running with Git Transcripts
Chapter: Our first git repository
Lecture: Adding the jokes

Login or purchase this course to watch this video and the rest of the course contents.
0:00 You might feel a little bit cheated if we go over to our app and we run it. Remember what do we get? We get Hello World while fun.
0:10 I promised you jokes after all our project is called funny web. So let me just grab a couple of developer silly jokes Wes bos has this thing
0:19 called dad jokes. We cover a bunch on the Python bytes podcast, but this is an easy way to grab some.
0:24 So let's just go over here and I'll just nab a couple and we'll put them into some strings in our app. So over here I'll just do jokes.
0:33 It's going to be relationship status. I'll leave that in the database. Let me put a few more in.
0:44 Here we go. I wrote some jokes in there as a list of strings and let's go over here and and poor random and let's just go changes real quick to
0:53 tell a joke. And here the joke, what it's gonna be. It's gonna be random.choice from our jokes. And here we'll just put joke like that.
1:10 Pretty simple. Pretty simplistic really. But let's go ahead and run it and just see if we can get a joke
1:15 There we go. Make a little bit bigger relationship status. I'll leave the relations to the database.
1:23 What diet did the ghost developer go on? a boolean. How do you get the code for the bank vault? You check out their branch that's a relevant one.
1:33 So there you have it. Funny web has reached its true potential, but we're not done. Are we? Let's check this into source control this time.
1:41 We'll go back over to PyCharm and we'll do it here. So I'll go I can either do commit or I could check it here let's go
1:49 over to the commit now again a little bit multi staged here. If I just say added the jokes I did it commit there's no nothing to commit.
2:04 Remember we have to do a add even on just the changes for the track file So that checkboxes git add desktop funny web/app.py and then
2:16 this this will do a git push to push those. This will do a git commit to local and then if we want to do a
2:25 push I could have done it all in one shot and now it's gone. I have to use this button, push it like that says where do you want it to go?
2:32 A little bit of confirmation. Wait for a second down on the right you see
2:36 pushed one commit to origin/main and switching back over here we refresh Sure enough
2:47 29 seconds ago we added the jokes and if we go click right there it'll actually show us the file changes. We added the jokes as a list so we imported
2:55 random we converted Hello world to tell a joke using the random library, lovely our app is complete.


Talk Python's Mastodon Michael Kennedy's Mastodon