Amid concerns of a looming teacher shortage, public officials in San Francisco and other cities are looking at housing as a tool to prevent the exodus of young educators.

School districts in high cost-of-living areas and rural communities that have long struggled to staff classrooms are considering buying or building rent-subsidized apartments as a way to attract and retain teachers.

Addressing the affordability crisis for teachers was one of the main selling points of a housing bond San Francisco voters approved in November. About $35 million has been earmarked for construction of up to 100 new apartments on surplus land owned by the San Francisco Unified School District.

School districts in Milwaukee, Odessa, Texas, Colorado's Roaring Fork Valley and Ashville, North Carolina also have apartment projects for teachers in the works.