2024-04-26 03:04:26 发布
网友
在我的钩子/路线中,我使用:
debug = request.GET.get('debug', False)
它与:
http://test.internal.local:8888/probe?debug=anything
但是我怎样才能让它只使用标志而不使用类似的值呢?你知道吗
http://test.internal.local:8888/probe?debug
谢谢
您仍然可以获得debug标志,但值将是空字符串('')。你知道吗
debug
''
所以检查一下你的旗子是否简单:
debug = request.GET.get('debug') # if there is no debug flag you get `None` if debug is not None: # you have your debug flag
您仍然可以获得
debug
标志,但值将是空字符串(''
)。你知道吗所以检查一下你的旗子是否简单:
相关问题 更多 >
编程相关推荐