Troops have been deployed on the streets of South Africa’s biggest city after the president announced plans last month to use the army to help police fight gang violence and illegal mining.