I use a flower pot with a screen on top. Dirt in the bottom, poop, then predators, then screen topped off with a brick or rock. Nobody bothers them and the flies are much better this year than last. I split mine between two pots.
I haven't had much of a problem with flies. Of course, there are some there, but being a horse person, maybe my tolerance for flies is better than some people's? Anyhow I think all the flies must've been migrating to my neighbor's veranda because I got a complaint from their landlord. They run misters for their three (not so nice) German shepherds. I'm thinking the flies like the cool and wet over there?
When I showed the neighbor's landlord my pen that is nearest his property line he was stunned how few flies there were.