寺内町（じないまち） “a town inside a temple” – a town developed around a Buddhist temple; should not be confused with monzenmachi which were towns catering for the needs of pilgrims in later times, nor the teramachi which were clusters of temples inside the castle towns.
Temple towns in civil war times
The temple towns were initially developed in late 15th and early 16th century by religious communities gathering around the temples of Jodo SHinshu Buddhist sect.
Initially the towns usually had defense measures sometimes up to par with warrior castles – the most famous example being Osaka (then officially called Ishiyama Honganji) which withstood 10 years of siege from the most powerful warlord of that time Oda Nobugaga. Some of these can still be seen today, like curved streets of Imai-cho obscuring the view of potential attackers as well as limiting the usability of guns.
Temple towns in Edo period
Temple towns survived the turbulent times of sengoku period and kept their identities as independently governed communities throughout structured and highly bureaucratic Edo period.
Some of these temple towns became satellite towns to nearby castle towns, like Kaizuka to Kishiwada, Isshinden to Tsu, Tonda to Takatsuki. Sometimes referred to as keizai mura (経済村) – the economic village – they were sort of contemporary special economic zones that gathered businesses.
Imai-cho in Nara Prefecture
Isshinden in Tsu City, Mie Prefecture
Isshinden was a relatively small community near the Tsu domain. In 1650s the temple burnt down and was rebuilt in a larger scale.