The big difference is raw_input doesn't exist in Python 3.x. Which Django module did you pull this code from? I'd be interested in seeing how they handle this issue for Py2/3 compatibility.