
Introducing DevBlog
(I'm not much for names)
So, I wanted to write a post describing the software that this site is deployed on, my project called DevBlog.
I have an obsession with new deployment technologies that has led me to set up a CMS several times (as described in my Hello World! post on this site). My biggest problem with side projects is I tend to get carried away with building automation and deployment stuff and never actually get around to working much on the project. However, I have overcome that! As described in that post, this is super simple to deploy and hack on, so I can spend my little bit of free hacking time actually adding features.
The site itself is run through Flask. Our main project at BAM-X is based in Flask, and I have been interested for a while in exploring architectural issues with the framework. How do you modularize your code, how do you use third party libraries, things like that... that would be super expensive to experiment with in a massive product code base but that I can try some things out on a side project and see what I like. I got started by reading THIS blog post and copying some of the code. Of course, I really like SQLAlchemy so I modified it to use that instead, and dropped some of the features (I will probably implement search using Elasticsearch at some point, since that is something else I want to experiment with).
Some things that I have learned building a big application with Flask were applied, like dynamic config files. This app didn't need everything we developed there, but for my work project we have our Config set up as classes, with the app choosing which one to use based on an environment variable (dev, staging, release...). This lets the release config inherit from the dev config and just overwrite things like the different database location and password. Docker makes it easy to run one-off scripts against the database using the Flask framework as well, so that I can easily run a docker-compose command from my laptop to add a user to the remote database.
Probably my favorite feature (at least among the ones I added, I really like the Markup libraries Charles used in his blog) is the image uploading. I have gotten a lot of practice dealing with files in S3 and setup the blog to upload images and serve them directly from there so that I don't have to mess around with local filesystem issues. The header files are built into the blog post format at this point. Even better, I built an AJAX endpoint that can upload an image and return a link to it for embedding into the post directly, like this...


I know VERY little Javascript, so I was psyched by getting that working. I'll probably want to build some more dynamic frontend stuff eventually, but that has time.
I think the next feature I'll add is probably comments- though if I choose to do something other than DISQUS I'll have to be careful, comment spam is a real pain to deal with.