Everything I know about Python...

Help turn Writing Idiomatic Python into a video series!

Click here to view the Kickstarter campaign

Help Turn Writing Idiomatic Python Into a Video Series
Posted on by

Let's turn the book "Writing Idiomatic Python" into a series of how-to videos!


I loved writing "Writing Idiomatic Python." And I love giving talks at meet-ups and such on the topics covered in the book. The book has proven to be an effective way for novice and intermediate programmers to take their Python coding skills to the next level. I couldn't be happier...

But I want even more developers to benefit from the book's ideas. That's why I want to turn "Writing Idiomatic Python" into a series of recorded screencasts. The format will be as follows: I'll take real-word code of questionable quality and refactor it into beautiful, Idiomatic Python. I'll narrate my thought process as I do so and will refer to specific idioms mentioned in the book. I'll also introduce new idioms not included in the book. You'll get to see exactly how to transform your code into idiomatic Python.

There will be a minimum of 10 videos, each about 30 minutes in length. If I raise $10,000 or more, the videos will all be released under the Creative Commons license. If I raise $25,000 or more, I'll double the number of videos I create. That means 10+ hours of Idiomatic Python goodness, free for everyone!

There are sweet incentives (free tutoring sessions, signed copies of the book, a day-long seminar for you and 25 friends, etc). Help me help other Python programmers! Back the project by clicking here!

Read on →

First Review Of Open Source Python Project Is Available
Posted on by

The first open-source Python project review is now up. It's for a library called alchy, a project I very much enjoyed reviewing. More reviews are on the way, so don't worry if you emailed me and I haven't responded yet.

In other news

Interestingly, this was the first time I made use of the review application that I wrote but the community now maintains. I've found the quality of the application has improved, and I'm truly impressed by what the various contributors have been able to accomplish with no central authority. The CONTRIBUTORS.md file (which I know to be incomplete), has the following contents:

So thanks to those on that list (and to those who forgot to add their name).

"Upgrading" the review app was seamless. I basically just did a git pull and was able to use the resulting directory as-is to serve reviews.jeffknupp.com. Pretty awesome considering the number of changes that complete strangers have made to it!

Free project reviews!

Remember, if you have an open-source Python project, send me an email with a link to the source and documentation and I'll do my best to review it on reviews.jeffknupp.com.

Also, if you're looking for an open source Python project to contribute to, the site itself is an open source Flask application that can be found at github.com/jeffknupp/review/. I accept any pull request (as long as it doesn't delete functionality), so the barrier to becoming a contributor is pretty low. Please fork!

Read on →

What Is A Web Server Part 2: Headers And Cookies
Posted on by

Jump to other posts in this series

  1. Part 1

In part one we created a super-simple web server capable of handling a simple subset of HTTP requests. In this post, we'll flesh out our web server a bit more, adding support for header parsing, content negotiation, and cookies.

Read on →

Learn to Host Your Python Web App by Watching a Pro
Posted on by

A tutoring client who was nearing the end of the Django project he's been working on asked how he should host his service. I explained to him that there are basically two options: use a service that takes care of everything for you (like Heroku or Google App Engine) or get a VPS and do everything yourself. After begrudgingly suggesting he use a service like Heroku, I wondered why there wasn't some sort of middle ground.

The Problem

My client's situation is an extremely common one: "I finished my web app and want to launch it. I'm not a Linux sysadmin. Now what?" If you decide to pay for a service to take care of all the details for you, you learn nothing in the process. Worse, when stuff goes sideways (and it always does), you're totally reliant on said service to fix things. You, yourself, don't have any power to fix issues outside of your application. If you need to scale, you better hope the service you chose scales with you.

On the other hand, if you rent a VPS, you're essentially dumped to the command line of a fresh Linux distro installation. Forget things like security and monitoring, just getting your web application working consistently involves a ton of work. You need to become a DBA/sysadmin over night. Any issues with the machine and you're in for a night of Googling about arcane Apache error messages or PostgreSQL config files.

Why doesn't a third option exist? In home repair, for example, there is an option between "hire someone" and "buy the materials and do it from scratch": many chains (like Home Depot) offer classes taught by professionals wherein you'll learn enough to complete your project, while still maintaining total control over it. Why doesn't something like that exist for web hosting?

straphost: The Solution

When I was first learning to deploy web applications, I would have thrown money at someone offering to set up my application while at the same time explaining what they were doing and why. I think there's a real need for a service that sets up your web app according to up-to-date best practices while at the same time teaching you how to do so. I would also have appreciated someone teaching me how to solve common maintenance issues, so let's include that as well.

That's why I'm announcing the creation of straphost ("bootstrapped hosting"). Think of it as both a VPS provider and a tutoring service. I'll teach you how to set up your Python web application with the web server/database of your choice as well as provide you the infrastructure on which to do so. We'll also set up tools like supervisord and cron/celery for your project. After your application is installed, you'll have full control of your application server. Want to enable a service like Loggly or PagerDuty? Feel free to do so yourself, or ask for help and we'll do it together.

Where We Are

At the moment, I'm still in the process of provisioning the hardware, but that will be finished in days. I've not come up with a pricing model, but assume it will be a very reasonable flat monthly rate plus an hourly charge for tutoring sessions in which we administer the application. Note that the tutoring portion is entirely optional; if you know how to do it yourself and just want a VPS from some random Internet blogger, that's fine with me. Also, I'll be hiring 24/7 technical support for when you have a problem that needs to be solved now.

Which reminds me: there's a lot of sales-y type stuff for me to do (for example: make a web site for this). That said, if I've piqued your interest, please email me at jeff@jeffknupp.com to get notified when this is available (likely sometime later this week). The initial cohort of clients will be extremely limited. This will let me devote enough time to each client while at the same time proving to myself that the model works.

Let's Do This

I've been tutoring long enough to know that this is a real issue; you either pay a service to take care of everything or pay a VPS provide to take care of nothing. There needs to be some middle ground. If you have a Python-based web application you'd like to learn how to launch and maintain, straphost may be just what you're looking for. Email me and we'll find out together.

Read on →

What Is A Web Server?
Posted on by

A recent post, titled "What Is A Web Framework" received quite a positive response. A number of readers, though, wanted me to do a deeper dive into web servers themselves. You may have heard of web servers like Apache(http://httpd.apache.org) or nginx. Ever wondered how they work? In this post, we'll cover what a web server is, why they exist, and how to build your own.

Read on →

Web Analytics