Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/337.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
Php 属性错误';str';对象没有属性';阅读';_Php_Python_Django - Fatal编程技术网

Php 属性错误';str';对象没有属性';阅读';

Php 属性错误';str';对象没有属性';阅读';,php,python,django,Php,Python,Django,我想将我现有的PHP应用程序与新的Django框架集成。 我正在使用django php桥 我想要的是使用现有的PHP身份验证方法对django应用程序进行身份验证。我能够通过PHP生成会话密钥,并希望使用桥接器将其放在Django会话表上。但是我遇到了错误。 你能为这个问题提出一个更好的替代方案吗 def _unserialize(): type_ = fp.read(1).lower() if type_ == b'n': _expe

我想将我现有的PHP应用程序与新的Django框架集成。 我正在使用django php桥

我想要的是使用现有的PHP身份验证方法对django应用程序进行身份验证。我能够通过PHP生成会话密钥,并希望使用桥接器将其放在Django会话表上。但是我遇到了错误。 你能为这个问题提出一个更好的替代方案吗

 def _unserialize():
        type_ = fp.read(1).lower()
        if type_ == b'n':
            _expect(b';')
            return None
        if type_ in b'idb':
            _expect(b':')
            data = _read_until(b';')
            if type_ == b'i':
                return int(data)
            if type_ == b'd':
                return float(data)
            return int(data) != 0
        if type_ == b's':
            _expect(b':')
            length = int(_read_until(b':'))
            _expect(b'"')
            data = fp.read(length)
            _expect(b'"')
            if decode_strings:

Request Method: | GET
-- | --
http://localhost:8000/
2.2.2
AttributeError
'str' object has no attribute 'read'
C:\xampp\htdocs\test\dbs\env\lib\site-packages\phpserialize.py in _unserialize, line 473
C:\xampp\htdocs\test\dbs\env\Scripts\python.exe
3.7.3
['C:\\xampp\\htdocs\\test\\dbs',  'C:\\xampp\\htdocs\\test\\dbs\\env\\Scripts\\python37.zip',  'C:\\xampp\\htdocs\\test\\dbs\\env\\DLLs',  'C:\\xampp\\htdocs\\test\\dbs\\env\\lib',  'C:\\xampp\\htdocs\\test\\dbs\\env\\Scripts',  'c:\\users\\arjun soota\\appdata\\local\\programs\\python\\python37-32\\Lib',  'c:\\users\\arjun soota\\appdata\\local\\programs\\python\\python37-32\\DLLs',  'C:\\xampp\\htdocs\\test\\dbs\\env',  'C:\\xampp\\htdocs\\test\\dbs\\env\\lib\\site-packages']
Thu, 20 Jun 2019 11:46:50 +0530