When the production of Labor Day (2013), a film Reitman had been preparing, was pushed to 2012, a window developed, and he decided to direct Cody's spec script as his next film after Up in the Air (2009). The script was inspired by an article Cody read about a woman who decided to pursue her high school sweetheart years later. While the article had a happy ending, Cody thought to herself, "What if it didn't?" Theron was Reitman's first and only choice for the lead role. At the 2009 Academy Awards, Reitman personally asked Theron to star in the film, which she accepted. By mid October 2010, Patton Oswalt, Patrick Wilson, and Elizabeth Reaser were cast. Oswalt was cast after doing a table read-through of the script at Reitman's house. Oswalt said that because his character, Matt Freehauf, had been badly beaten as a teen and was required to walk with a brace, he consulted with both an acting coach and a physical therapist to prepare for the role. At the same time, with a budget of $12 million, principal photography commenced, and wrapped in early December. Filming took place throughout Minnesota and New York.