Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从数据库django获取数据时出现问题_Django_Database_Postgresql_Authentication - Fatal编程技术网

从数据库django获取数据时出现问题

从数据库django获取数据时出现问题,django,database,postgresql,authentication,Django,Database,Postgresql,Authentication,我面临一个大问题。我使用此查询是为了从数据库中获取数据: try : user = UserModel.objects.get(subject_dn=subject_dn,issuer_dn=issuer_dn) except Exception : raise exceptions.NotFound(' User corresponding to the entred Certificate is not found in th

我面临一个大问题。我使用此查询是为了从数据库中获取数据:

try :
            user = UserModel.objects.get(subject_dn=subject_dn,issuer_dn=issuer_dn)
        except Exception : 
            raise exceptions.NotFound(' User corresponding to the entred Certificate is not found in the System')
        logger.info('this is the found user %s' %user)
问题是,即使我在数据库中有用户:我总是找不到用户。。。有人能给我解释一下为什么会这样吗


谢谢

是您的型号的名称
UserModel
?你能分享你的模型吗