Q:

Integrate python code with django by not using any database to build web interface

I have a python code that takes few inputs from user and gives the output. It doesn't require any database. Now I want to build a web interface using django. I want to know how the python code can be integrated to django for the web interface without using any database.

A:

You don't need to use the database. Just write your Python code into the view and put the output into the dictionary passed to the render function.
views.py:
def my_view(request):
    # Do stuff and set value
    return render_to_response('my_page.html',
                              {'value': value},
                              context_instance=RequestContext(request))

