Esempio n. 1
0
def envDATA(context, elem_cont):
    """
        Para Probar cosas, mostrara por pantalla usuario, conexion a BBDD...
    """
    resul = list()
    try:
        from YBUTILS.DbRouter import dameConexionDef
        from django.db import connection
        from copy import deepcopy

        micon = dameConexionDef()
        resul.append("BBDD POR LIBRERIA--------------------------")
        resul.append(micon.alias)
        auxdict = deepcopy(micon.settings_dict)
        auxdict["PASSWORD"] = "******"
        resul.append(DICTJSON.toJSON(auxdict))
        micon = dameConexionDef()
        resul.append("BBDD django.db.connection-------------------")
        micon = connection
        resul.append(micon.alias)
        auxdict = deepcopy(micon.settings_dict)
        auxdict["PASSWORD"] = "******"
        resul.append(DICTJSON.toJSON(auxdict))
    except:
        pass
    try:
        # requiere TEMPLATE_CONTEXT_PROCESSORS=('django.core.context_processors.request',)
        mireq = context["request"]
        resul.append("HTTP HEADERS-------------------")
        for k, v in mireq.META.items():
            try:

                resul.append(str(k) + "--->" + str(v))
            except:
                pass

    except:
        pass

    return "<br/>".join(resul)
Esempio n. 2
0
def envDATA(context, elem_cont):
    """
        Para Probar cosas, mostrara por pantalla usuario, conexion a BBDD...
    """
    resul = list()
    try:
        from YBUTILS.DbRouter import dameConexionDef
        from django.db import connection
        from copy import deepcopy
        micon = dameConexionDef()
        resul.append("BBDD POR LIBRERIA--------------------------")
        resul.append(micon.alias)
        auxdict = deepcopy(micon.settings_dict)
        auxdict["PASSWORD"] = "******"
        resul.append(DICTJSON.toJSON(auxdict))
        micon = dameConexionDef()
        resul.append("BBDD django.db.connection-------------------")
        micon = connection
        resul.append(micon.alias)
        auxdict = deepcopy(micon.settings_dict)
        auxdict["PASSWORD"] = "******"
        resul.append(DICTJSON.toJSON(auxdict))
    except Exception:
        pass
    try:
        # requiere TEMPLATE_CONTEXT_PROCESSORS=('django.core.context_processors.request',)
        mireq = context['request']
        resul.append("HTTP HEADERS-------------------")
        for k, v in mireq.META.items():
            try:
                resul.append(str(k) + "--->" + str(v))
            except Exception:
                pass
    except Exception:
        pass

    return "<br/>".join(resul)
Esempio n. 3
0
 def nameBD(cls):
     try:
         micon=dameConexionDef()                    
         return str(micon.settings_dict["NAME"])
     except:
         return ""
Esempio n. 4
0
 def __damecursor(cls,miconnection=None):
     if miconnection:
         return connections[miconnection].cursor()
     else:
         return dameConexionDef().cursor()
Esempio n. 5
0
 def nameUser(cls):
     try:
         micon=dameConexionDef()                    
         return str(micon.settings_dict["USER"])
     except:
         return ""