August 3, 2015 by Keilan
Hello Gamers,
If any of you are exceedingly observant, or enjoy poking around my source code, you might have noticed some changes around the site recently. This is because I've migrated from a site that I cobbled together using php (which I don't know) to using Django, a python framework that simplifies a lot of web development. It's also the framework that I have the most experience with as I use it professionally. I decided to migrate the site for a number of reasons:
- DRY - Don't Repeat Yourself is a major principle of the Django framework and as I thought about the future of scholtek.com, I realized that if I'm going to store multiple games here, I could end up with a big task if I want to make a minor change to the game interface. Django templating allows me to build a base template, and then extend it for each individual game, so changes can made quickly and easily.
- Speed - It's no secret that free online games don't bring in a lot of money. So far I've been able to recoup my server costs, but just barely. Breaking even is still a better return than most hobbies, so I'll take it. However, this means that I want to be able to handle a lot of traffic without much server power. Django has an extensive caching framework, and since my site is almost entirely static content, it's a perfect use case for caching. My hope is that even a small server will be able to handle so much traffic, that if I get to that point I can buy a better server.
- Extensibility - When I started Scholtek, one of my goals was to learn website building from the ground up. That meant as few frameworks and existing libraries as possible. However, now that I have that experience I want to be able to build the site more quickly and easily. For that, Django really shines. It has a vibrant community and a large number of plugins, not to mention Stack Overflow questions (and we all know programming is really just finding the right answers on SO). Previously I had been spending hours on things that could take minutes, which was a great learning experience, but moving forward, Django will let me spend days on things that would take months to do on my own. Less feasible for a hobby developer.
So far the transition has been quite painless - I used fairly limited php and so the Django template system has been more than adequate to replace it, and in cases where it wasn't, it was quite simple to write extra template tags to take over. My code repetition has been reduced greatly, and I feel much more confident in my ability to extend the site. My next step is to find an affordable VPS to deploy on, and set up some handy functionality like automatic minification and one click deployment. But that's a separate post.
To be continued...
-Keilan