Rats crawl over piles of garbage. Washing is hung out to dry under an electricity pylon. Three donkeys peer over a fence improvised from rusted mattress springs. A small boy rides inside a black rubbish bin that his father hopes will pass as a baby buggy.

Strewn with beer bottles, broken glass and giant cacti, this blasted landscape is the stuff of post-apocalyptic science fiction. So perhaps it is no surprise that Chiawelo, a squatter camp in Soweto, is the backdrop to the hit sci-fi blockbuster of the summer.

District 9 is the story of aliens stranded in an impoverished South African township. As their spaceship hovers above Johannesburg the aliens, whose physical appearance earns them the unflattering nickname "prawns", live in squalid shacks behind barbed wire and barter with gangsters to satisfy their addiction to cat food.

The $30m (£18m) film, produced by Lord of the Rings director Peter Jackson, was number one at the US box office in its first weekend and has grossed $90m so far. It is tipped to take Britain by storm when it opens this week after earning reviews as a thrilling allegory of apartheid and xenophobia.

It has also given the people of Chiawelo an unlikely place in film history. The community, which lacks electricity and running water, gazed in wonder at the arrival of film crew and set-builders at their informal settlement. The spectacle of actors dressed up as aliens caused surprise and even some alarm.

The convoy of trailers is now long gone and there are mixed feelings about the experience. Some residents were grateful for the diversion and the money they received as extras. They hope the film will raise awareness of their plight and force the government to help them. Others, such as Sydney Mofokeng, 32, say they are bitter and feel exploited. Mofokeng, a sangoma – traditional healer – lives in a tiny one-room shack amid heaps of discarded shoes, toilet pipes and shredded mattresses. He is unlikely to ever see the film.

Transport to the nearest cinema and the price of admission are beyond the reach of jobless residents forced to forage for firewood to keep warm. "I'd like to see it but I can't go without money," he said. "I used to go to the cinema but now I don't have a job and transport is difficult. I hurt my leg so it's too far to walk."

Chiawelo is a desolate place. The rough, uneven landscape is dotted with rubble, cesspools and ramshackle buildings of concrete or tin. One shack is made from slabs of cardboard and advertising signs. Children play with plastic bottles in the dirt. Shirtless men bend over water bubbling from a solitary communal tap.

The smiling face of President Jacob Zuma looks out from faded election posters on battered portable toilets. Above it all tower electricity pylons and cactus plants and, on the horizon, a hot air balloon sponsored by a bank and designed like a football.

Just like the aliens in District 9, the people here are set for relocation whether they like it or not. And some do not. Matilda Isaacs, 54, lives in a metal and wood structure under a dusty canvas awning.

But the mother-of-four opposes plans to transfer her to government housing six miles away. "We don't want to move," she said. "We'd like to stay here, we are happy here. Rich men come and make films here."

Sitting nearby, Johannes Maleleka, 39, was less certain. "We are suffering," he said. "We have nothing, not enough money to eat. I sleep on the street and it's very cold in winter. I would like a house." France Mokoene, 24, added: "There are six of us in a shack. It's difficult because we sleep in a small room and don't have much privacy. I spend my days there or playing on the soccer field."

Mokoene, who was paid R150 (£12) a day as an extra in the film, said the producers had been in touch with him recently about making a sequel.

On the opposite side of the street are the brick houses and shops of modern Soweto, the township once synonymous with the privations of apartheid. There have been steady but uneven improvements over the past 15 years, symbolised by the opening in 2007 of one of Africa's biggest shopping malls.

This week sees the fifth annual Soweto wine festival, while the redeveloped Orlando stadium will be used as a training venue during next year's football World Cup.

But crime remains a constant fear in forgotten corners such as Chiawelo.

Neill Blomkamp, District 9's first-time director, was afraid that the production's convoy of vehicles would be a conspicuous target. One night his driver was carjacked when attackers put a gun to his head.

"The people are warm, but the environment is so caustic and unbelievably disgusting to be in," he said in a recent interview.

"Every single thing is difficult. There's broken glass everywhere … rusted barbed wire … the level of pollution is insane. And then in that environment, you're trying to be creative as well. But of course, that gave birth to the creativity, so it kind of goes both ways."

It is a daily reality for people living in "the real District 9". Sylvia Khoza, holding her one-year-old daughter, Unathi, said: "This place is unsafe. There is all kinds of criminality: robbery, rape, murder and all that. The film-makers had a lot of security with them."

Khoza, 24, said the film had opened new doors for some. "90% of people here worked on it. Now some of them are working as actors. The film helped people here to realise their talent."

Sydney Mofokeng, however, was not so convinced. "We are the people," he said, "And we are still here."