Lets say you want to keep your index.html template file and generate a rendered version of it from a context like {'name' : 'John Doe'} into a file called index2.html. You could achieve this by first getting the text output from rendering index.html with a given context and then writing that to another html file.
I am assuming you have your index.html file in 'templates' inside you django project and you've left BASE_DIR setting to the default value.
import os
from django.template import engines
from django.conf import settings
# Get rendered result as string by passing {'name' : 'John Doe'} to index.html
with open(os.path.join(settings.BASE_DIR, 'templates'), 'r') as f:
template = engines['django'].from_string(f.read())
text = template.render({'name':'John Doe'})
# Write the rendered string into a file called 'index2.html'
with open(os.path.join(settings.BASE_DIR, 'templates','index2.html'), 'w+') as f:
f.write(text)