While District 9 is certainly an allegory for racism and apartheid in South Africa, not all of its South African inspirations are political. Neill Blomkamp's aliens were inspired, in part, by a common Johannesburg pest: the Parktown Prawn.
After District 9 screened in Johannesburg, many noted that the "prawns" — as the aliens are contemptuously referred to by many humans — are a reference to Parktown Prawns, a common and much-loathed creature often found in Johannesburg homes. Parktown Prawns are not, in fact, prawns, but a species of king cricket that has likely been around since prehistoric times. The critters can grow up to 10 centimeters in length, and sport barbed legs and powerful mandibles.
But it's more than their name and their insect-like appearance that the District 9 aliens borrow from the South African bugs. One of the Parktown Prawn's less endearing qualities is its tendency to spew a noxious black sludge, which one commenter on the William Gibson discussion board points out is likely the inspiration for the black alien liquid that is central to the movie's plot.
As for human interactions with the Prawns, a New York Times article from a decade ago relates a story of a woman who screamed upon spotting a Parktown Prawn, prompting the confused creepy crawly to leap into her mouth, and was summarily rushed to the hospital after chocking on the barbed legs. But the commenter from the William Gibson boards takes a much calmer approach:
[T]he real secret is to TALK to your Prawn — I would always say, "Hello, Prawn, well, I know this is a nice house but really, you belong outside in the garden, so just stay calm, and I'll pick you up and put you there." It really works, if you ever encounter a Prawn, try it.
The film's military contractor, Multinational United, would likely be impressed, since they advise a similar approach:
When dealing with aliens, try to be polite, but firm. And always remember that a smile is cheaper than a bullet.
[William Gibson Discussion Board via Reddit]
These Streets Belong to the Pre-Millennium Bug [NY Times via Reddit]