Example #1
0
def dashboard(request):
    con = connections.mysql_con('gaadi')
    result = con.execute_query("SELECT * FROM vmn_cp")
    context_data = {'body_template': 'dashboard/dashboard.html', 'session_data': request.session, 'vmn_table':result}
    print "inside dashboard"
    try:
        user_id = request.session['user_id']
    except Exception as e:
        logger.error("dashboard : " + str(e))
    context = RequestContext(request, context_data)
    template = loader.get_template('commons/main_include.html')
    return HttpResponse(template.render(context))
Example #2
0
__author__ = 'yusuf'
from gaadi.models import connections
import logging

dbconn = connections.mysql_con('gaadi_panel')
logger = logging.getLogger(__name__)

def user_authenticaton(username, password):
    logger.info(username)
    query = """SELECT user_id, username, role_id FROM user_master WHERE username="******" AND password="******" """%(username,password)
    result = dbconn.execute_query(query)
    print result
    return result