I'm also confused why this code is showing up in the PR, because when I checked out your branch, I got this instead:

    resp["Location"] = course_locator.url_reverse('/textbooks/{tid}'.format(
        tid=textbook['id']))

Better, but could still be improved with the 2-arg version of url_reverse.