Extract template nodes from a Django template