No, it's not from a movie - this couple really did rig their farmhouse with a shotgun door trap. And a burglar really triggered it!
"Katko v. Briney, 183 N.W.2d 657 (Iowa 1971), was a court case decided by the Iowa Supreme Court, in which two homeowners (Edward and Bertha Briney) were held liable for battery for injuries caused to a trespasser (Marvin Katko) who set off a spring gun set as a mantrap in an abandoned house on the homeowners’ property."
More on Wikipedia:
https://en.wikipedia.org/wiki/Katko_v._Briney