Hi.
It sounds like you need to change your code structure a bit to really
take advantage of Django and the possibilities it offer. If you just
want
to get your stuff working with Django and then nothing more, I guess
you could keep it like it is, but else re factoring would be a good
idea.
The way django works, you want to keep the logic separated from the
presentation. So basically that means, that you should keep the Python
code separated from your HTML. In Django terms, we use the view
to make the logic, where we can if needed, import helper functions.
When all the data has been calculated, we pass it to a template, a
html file where we with some Django code can insert data dynamically.
It sounds like you need to grasp these things, before you really get
going.
about writing views:
http://docs.djangoproject.com/en/dev/topics/http/views/
about the template language
http://docs.djangoproject.com/en/dev/topics/templates/
about render_to_response:
http://docs.djangoproject.com/en/dev/topics/http/shortcuts/#render-to-response
Render to response is common way of passing data to a template for
display.
Which was what your initial question was about. But I would recommend
that
you strip the html from your Python code and instead put the html in
your template
instead. That would be a more clean and Djangoish way of doing it.
~Jakob