I sprinkle DE inside the coop and the nesting boxes; in the pine shavings, on the roosts, etc and the flys are not a problem in there at all.
I do have issues with them out in the run, so I spray down that area every day, making sure to hit all the poop spots really good. No poop = no flys...