﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
11657	Displaying Data from database(MySql)	sumeet	nobody	"I am new in using Django and I want to display multiple rows from the database in my html page. I have made the necessary entries in views.py, urls.py and in the html file. The following is my code :

'''Code in views.py'''

def process(request):
    data=[]
    db = MySQLdb.connect(user='root', db='books', passwd='admin', host='localhost')
    cursor = db.cursor()
    cursor.execute('SELECT * FROM sms_recieved_dummy')
    data=cursor.fetchall()
    db.close()
    return render_to_response('process.html', {'datas': data})

'''Code in process.html :'''

{% if datas %}
        <ul>
            {% for d in datas %}
            <li>{{ d }} </li>
            {% endfor %}
        </ul><br>
   {% endif %}


Here the problem is ... I want to display all the column data from each row from the database individually in my html in table format. How can i do that ? "		closed	Uncategorized	1.1		invalid			Unreviewed	0	0	0	0	0	0
