I saw https://www.thingiverse.com/thing:1705706 and liked the idea, but not the idea of gluing the lens in place. So I made a press fit camera and lens housing case. Works with https://www.amazon.com/Kogeto-Panoramic-Accessory-iPhone-Black/dp/B005NFINYC 360º iPhone camera lens and 3mm bolts and nuts. It holds the Raspberry Pi camera and the lens snugly in place without the mess and hassle of glue. The lens simply unscrews from the clip frame it comes on, and you press it into the case by hand.
Technical
I used PLA but most any filament will work. Supports are needed, but if printed as the files are, the rougher supported area will be inside of case when closed.
Once printed pop parts off your print bed, insert Raspberry Pi camera, bolt together and press fit the lens into the case for a snug and secure fit.