sanic-auth报错'Blueprint' object has no attribute 'config'
时间: 2023-11-18 14:02:52 浏览: 217
根据提供的引用内容,sanic-auth报错'Blueprint' object has no attribute 'config'可能是由于在使用蓝图时没有正确配置导致的。可以尝试在蓝图中添加配置项,例如:
```python
from sanic import Blueprint
from sanic.response import json
bp = Blueprint('my_blueprint')
@bp.route('/')
async def test(request):
return json({'my': 'blueprint'})
bp.config.update({
'MY_BLUEPRINT_CONFIG': True
})
```
如果仍然出现相同的错误,请检查是否正确安装了sanic-auth,并且是否正确导入了需要使用的模块。如果问题仍然存在,可以尝试查看sanic-auth的文档或者在sanic-auth的GitHub页面上提交issue以获取更多帮助。
阅读全文
相关推荐


















