Tag: blog

Python 3

Yeah, I spent an entire Saturday upgrading this blog to use Python 3. What a great use of my time…. This includes about 5 hours I spent switching the site to use FastCGI as the entry point instead of Passenger, only to switch it right back to Passenger. (Kind of glad I did, actually, as the FastCGI required a delicately tuned set of mod_rewrite rules. However, it can cause an annoying delay when first loading my page because Passenger has to spawn a new interpreter to use Python 3, and to make matters worse my hosting provider kills the interpreter after only a few minutes.)

Anyway, there’s (kind of) a reason for it. I have a separate need to host a different web application, which would have required me to set up a new Python environment, so I figured I might as well take care of the blog while I was at it. (I’ll cover the new app in a later post for my Faithful Readers.)

Another good thing: I diagnosed an issue where every page load was sending upwards of 50 queries to the MySQL database. Now it sends only a few. That usually makes it faster even if it has to spawn a new Python 3.

Blog Back Up

Well, the greatest nightmare the Internet has ever seen is finally over: my blog is back up.

Let that be a lesson to me never to trust programs that say they will still work when something is suddenly upgraded.

New Blog

I’ve had a web presence since 1995.

In those 15 years, many things about the World Wide Web have changed tremendously, but one thing has remained the same: my web pages have been almost entirely static. Except for a few minor cgi-bin applications (including the Oracle of Notre Dame in a previous form), all my web content was edited on my desktop, uploaded, and served as-is.

Well, I’ve finally jumped on the dynamic content bandwagon. Welcome to my new blog. Like any respectable web app, it stores content in a database and retrieves it upon request.

So what pushed me over? Well, it’s mostly a matter of the right technologies coming together and getting support from inexpensive web hosts. Until recently (last few years), most inexpensive web hosts only supported dynamic content with PHP (which I will never touch) and cgi-bin scripts. CGI is terrible for anything more than trivial apps. But lately web hosts are supporting a wider variety of web frameworks (largely due to the success of Ruby on Rails, I think).

With that development I began considering to implement my own dynamic content in Python. There are now tons of libraries one can leverage to take care of the gory details (and that’s all I wanted—which is why I didn’t go with a framework like Django). I found CherryPy to be especially helpful to take care of all the HTTP aspects, while not being overly formulaic to use. The major libraries that came together for my blog are:

  • CherryPy manages the HTTP aspects
  • Mako manages the HTML templating
  • Docutils converts user input to HTML
  • SQLAlchemy manages the database
  • Elixir set up the SQLAlchemy’s ORM classes

I threw together a couple small apps with CherryPy and SQLAlchemy, and then decided I was ready to try for a blog, and here it is.

Frontier Theme