Day Eleven – You just gotta do it (see project overview)
I was going to dedicate some time to advanced Python, but I think I’m just going to try to get into the habit of taking in one new advanced topic per day for awhile. Sometimes I kick myself for not doing any x (x can be anything, but let’s say x is pushups) for several days. I end up comforting myself by saying, “even if you only do pushups once per week, if you do 15 pushups each time you do pushups, you’ve still done 780 pushups in a year. I’m thinking that should help a person be stronger.
Also, I read something about guitar practice that I think is true. The information basically was that shorter, more frequent practices are better because we succumb to boredom and tire if the lesson is too long. Also, we remember the beginning and ending of lessons much better than we remember the middle parts, so it’s better to have more short lessons so that we have more beginning and endings and less fatigue-inducing middle parts.
Push-ups and guitar practice?
So, today, I’m going to
- Learn about certificates and, perhaps, get one or two. I think I need one for susanenneking.dev.
- Get my twitter stuff translated from PHP to Python/Django using just out-of-the-box Django
Can I do those two things in one day? Probably not. Some of my “Days” have been a couple days. I hope that doesn’t look like cheating. I’ll put the caveat in the intro to these posts that it may have taken me 30 days to actually complete these 11-days worth of activities.
Not sure what happened during the past 5 days, but it didn’t have anything to do with what I’d hoped would take place. So, I’m going to use Reindert-Jan Ekker’s, “Django: Getting Started” Pluralsight course. I find it interesting that he has two “getting started” courses. This time, I’m going to build my app as he builds his.
I’m not proud that I’m going through a second getting started course, but these courses contain the steps to start an application. These are things that a programmer only does occasionally. And, each time we do them, they are slightly different because the tech landscape will have changed a bit. This course was done in 2020 (as opposed to 2017 for for the “Django: Fundamentals” course). So, I guess this is really his only “getting started” course. This one is labeled “beginners” and the Fundamentals course is labeled “intermediate”.
Keeping my head down…
Going through the basic Django info for the third time makes me realize it’s pretty easy to use. My original plan was to incorporate react pretty early on into the Twitter app. But, I think using the templates feature provided by Django is going to be enough for now.
Django folder structure…weird
A second weirdness is the folder structure. Django naturally puts the project folder (with settings.py, urls.py, …and others) in its own folder and all of the apps in separate folders outside of this folder. I kind of like this arrangement, but it sounds like others prefer to have the app folders inside this project folder. I’m going to leave it the way Django does it, naturally, but I may change my mind after working with it a bit.
Another suggestion that Reindert-Jan Ekker gives is to create an app folder inside the templates folder which is inside the app folder. I’m going to do this, but I don’t really think it makes sense. The templates folder is already inside my app folder. I feel like there is something that I don’t understand here, so I’m going to leave it. Still, it’s weird to me.
Templates outside
I looked at the folder structure from Reindert-Jan Ekker’s previous course and it does have templates outside of the app folders with a subfolder for each app. This makes sense. I’m rearranging, now. Also, javascript in the static folder, which should exist at the root level should be arranged by app.
After a bit more learning and tweaking, I can see that Django has this pretty well figured out, so I will not worry about it.
Twitter has rules!
I’m working on getting the Twitter Research Site Django/Pythonized. I’ve been re-reading the Twitter documentation to see if its ok to just put this out there. I think it is. I can’t ask people for their Twitter app keys or anything like that, but I think I can give them data with my app keys. They may need to be required to read the Twitter “Terms of Use”. I’m not sure about that.
More info about how the twitter app came into existence here, but the short story is that I wrote it originally in PHP and deployed it to Heroku to help my daughter-in-law, Mel, collect data for her Masters research. She liked it a lot and suggested I could market it. I never felt that it would be practical because of how Twitter requires developers to apply for app set up. But, I think as a demo project, the idea is usable.
So, now that I feel I have the Django thing under control, I’m going to concentrate on the details of that app and try to put all the stuff I’ve learned together and get it deployed. I’m not going to worry about React, yet. Nor, am I going to worry about automated deployment—I’ll probably use Jenkins—yet. I’m going to plan to use Terraform for sure and, maybe, Docker.
Upon re-reading
It’s funny to me how many times I changed my mind while going through this whole thing. I probably do this all the time, but I don’t document it. Wow…I am wishy washy! I didn’t know!