Hi eantoranz, I just registered here to be able to answer you ;-)
You can put your items into templates by using macros (Zabbix speak for "variables"), e.g.
Code:
query_apachestats.py["{HOST.CONN1}", "arg2", "arg3"]
For an overview of all macros see
Macros supported by location..
The macro {HOST.CONN1} for example resolves to the first ip/hostname you specified for each host.
There is only one trap: an ip/hostname belongs to an "interface" (SNMP, Agent, IPMI, ...).
After applying the template to the hosts be sure to check if the items (on each host) have the correct interface applied.
For what you want to do, this would be the "Agent" interface.
A good way to set it quickly is by using Zabbix' mass update function.