Modeling the host galaxies of long-duration gamma-ray bursts