impactful human tech from simple tools



Update on web app

Deployment to tweaks

by Carl James | BLOOMINGTON, IN | July 4, 2024

Screenshot of application output during a game

Catching up since January

College Baseball season has come and gone, and although I blogged a lot in that time, it was using the app that I built, and not about the app that I built.

While I was please with what I had done, I kept making tweaks right up until the start of the season and did not leave enough time to deploy the application. I don't find deployment as daunting as many other web developers do, but done right, it takes time. Because of this, I ended up live blogging the games from Conway, South Carolina with the old WordPress site.

Deploying to Digital Ocean

Back at home I dug in and got the application up and running for the end of the second weekend of play in late February. I deploy to Digital Ocean via what they call "droplets". Droplets are just virtual linux servers.

Digital Ocean logo

I have tried several cloud providers over the years, usually when I got a free month via podcasts I listen too. None of them were bad. I settled on Digital Ocean due to the documented tutorials they provide which walks someone through how to deploy an application. For this deployment I used How To Set Up Django with Postgres, Nginx, and Gunicorn on Ubuntu which had an update just a few weeks before I deployed my application.

In the Django trainings I went through via books and online, they all steered developers far away from what I am doing here: managing my own cloud server in a manual way. The first time I deployed a dynamic app, I followed the guidance of Talk Python Training's Python for Entrepreneurs course which was to do essentially this, but use Ansible IT automation tools to manage the server. While I was able to do, I didn't feel like I really understood what was happening. After typing up the scripts, everything worked, but it was just a little too much magic for me. That plus the work around setting up Ansible seemed more involved than just typing the commands. As long as I take good notes and create directions for myself, I'm fine with the process taking a few minutes longer and getting clear feedback that what I did actually worked.

I have a long history of supporting endpoint devices (meaning personal computers). Endpoint devices are not unlike servers in that they are networked computers on the internet with an operating system. I didn't feel that I needed a tool to obfuscate away the details of managing the droplet. I wanted to dive in. What I realized through my own note taking and Digital Ocean's documentation is that I understand this all just fine, and I found removing the automation just made the whole process both simpler and made it so I had a decent understanding of what I was doing to manage the server.

I have also found that when I'm away from the process for a while, it is easier for me to pick it back up with a series of terminal commands instead of messing around in automation configuration files.

Discovering what I just didn't think about

In the live game blog application, I have a scoreboard that Django pre-fills out for me with the last information. It creates a new scoreboard entry in the database every time I make a change. The default value in the scoreboard is the prior entry. I tend to post a scoreboard every half inning or when a team scores. I don't post a new scoreboard after every hit or error, though. I often like to update the game with my insights in between these scoreboard events.

To make this even easier on myself I used a little bit of Python logic to auto-increment the inning if the prior scoreboard was from the end of an inning and reset the "outs" to zero for a new inning.

Screenshot from VSCode of Python code that populates the form

It was only through using the app that I discovered how much I needed this. I also put in logic later to change the "Bottom" and "Top" of the inning.

I made a few other minor tweaks including showing some of the model data I had collected to the readers including links to team statistic pages for each team and official rosters. Only after the season ended did I make some significant style changes. I used a smaller logo up on top and added a background out of page areas that included actual content to somewhat match the look of the WordPress site.


Carl James is CompTIA A+ ce Certified

Categories || All || Coding


See a complete list of all jovian34 blogs

As always, I'd love to hear you're thoughts and questions, so feel free to shoot a Noot to @jovian34 on Mastodon and I will gladly respond and perhaps write a blog post on a topic you suggest.