
For some reason I can’t understand, Python is the second most popular language out there1 At first glance the language doesn’t look promising. One complaint about COBOL was that you could screw up a program by an unwanted period. With Python it just takes a space. But I shouldn’t condemn the language because of a brief glance at the Python website. So I thought I would give it a shot. More recently I have been experimenting with Node, so that is my baseline
Here is my progress to date.
First step with any language is to geta “Hello World” program working. That is pretty easy. You just install Python and write a trivial program. Hello World pops out on the console. But that is not much use if you want to serve up web pages. Node comes with it’s own production-grade web server. But now I found myself back in the world of standard web servers.
This is something I am very familiar with so quickly loaded up Apache 2 and tried to install the mod_wsgi module which allows Apache to call Python programs in a nice secure way. Now I reckon I am quite good at this stuff and I used Apache for years. Yet somehow I was still struggling with it a couple of days later (not full time though). I don’t know what the issue was, but a lot of the material on the web was for an older version of Apache, so maybe that is why it didn’t go well.
It’s looking cool now. The routing tables are embedded in the Apache configuration files – I don’t like that. But I got a web page with ‘Hello World’ up eventually. The next step is to use a framework. There are a number of frameworks for Node, and I tried one of the more complex ones (Sails). But in the end I went for the minimalist Express framework to give me the most flexibility. The Express framework equivalent in the Python world seems to be Flask. So I installed it. Fairly straightforward, and so far I am back in Node territory in many ways.
Each project has it’s own environment, which is implemented in a somewhat Heath Robinson ( Rube Goldberg for Americans) way, but it works. no need for Apache for testing as Flask comes with its own basic web server. So far so familiar. The web server is not recommended for production, so for live deployment we would be back to Apache.
So I am ready to go. More on this later.
- Next to JavaScript obvs. But that is because browsers only run JavaScript. Well done browsers. ↩︎
Leave a comment