#100DaysOfWeb in Python Transcripts
Lecture: Interlude: Python Tips API back-end setup
0:01 In this video, we take a quick detour to get the Python Tips API set up locally so we can query it from our front end.
0:10 So I got this repo here on PyBites which is Python_Tips and we're going to clone it to our local directory. So I go to code and I clone it here
0:32 cd into it. And to make a virtual environment install the requirements.
0:52 Set a secret key for Django reactivate the virtual environment. I run my migrations which will be synced to a local SQLite3 database.
1:12 I make a super user. And I have a script here in tips, management
1:29 commands, sync tips. And that will reach out to the PyBites tips website and it's going to scrape it and import all those tips in the local database.
1:42 So let me run that now. 95 tips imported. Let's run the server and let's do a curl to 127:8000 API
2:05 and let's say, Tip 10. Anywhere you go, you see a dictionary of tip code, and a link, and a share link. It could be 12, 85, et cetera.
2:22 And this should get them all. This gets a whole bunch of tips. So this is cool. Now we have our API running.
2:29 And I can now further build out the front end to query this API and show the tips on the website. But before doing that
2:37 let's introduce classes in React and keeping track of state.