Zhangfang Township, a township under the jurisdiction of Fangshan District, Beijing, is located in east longitude 115°36′43″~115°46′39″, north latitude 39°32′40″~39°42′09″. It is located in the southwest of Fangshan District, neighboring Dashiwu Township in the east, Shiting Township of Lai Shui County, Hebei Province in the south across the Xiema River, bordering Shidu Township in the west, Xiayuling Township in the north, and connected with Hanchunhe Township in the northeast. The town area is 119.4 square kilometers.
During the Qing Dynasty (1644-1911), Zhangfang area was Zhangfangli, Fangshan County. In the fifth year of the Republic of China (1916), it belonged to eight districts of Fangshan County. 1949, it belonged to two districts of Fangshan County. 1950, it belonged to Zhangfang Township of Fangshan County. 1954, it belonged to three townships of Zhangfang, Qianhekou and Dongguanshang. 1958, it belonged to Zhangfang Management Area of Changgou People's Commune of Zhoukoudian District. 1961, it belonged to Fangshan County, and set up Zhangfang Township; in the same year, it was changed from Township to Communal Society. 1983, it was changed from Communal Society to Township. 1986, it belonged to Fangshan District. 1989, it was changed to Township. 1989, it belonged to Fangshan District. In 1989, the township was changed to a town. As of the end of 2018, Zhangfang Township has a registered population of 22,759. As of 2019, Zhangfang Township has 15 administrative villages under its jurisdiction, and the township government is located in Zhangfang Village North, Zhangfang Township.
In 2011, the total industrial output value of Zhangfang Town reached 61.884 million yuan, an increase of 3.5% over the previous year, with a total profit of 1.128 million yuan. The value added of industry was 8 million yuan. Local financial income of 10.786 million yuan, an increase of 10% over the previous year. Completed tax revenue of 32.702 million yuan, an increase of 19.2% over the previous year. From the point of view of each major tax, the completion of business tax 12.352 million yuan, 11 million yuan of corporate income tax, value-added tax 6.803 million yuan, land value-added tax 1.557 million yuan, urban construction tax 1.056 million yuan.