我正在为我的项目使用Django URL模式。我正在发送一个包含特殊字符和数字的字符串。在python函数中读取字符串时,它不会在函数中获取?。
断续器
{% for user_name in userSet%}
<a class="dropdown-item" href="/slackNotification/{{user_name}}/{{data.question}}">{{ user_name }}</a>
{% endfor %}
网址
path('slackNotification/<str:slack_user_name>/<str:question>',views.slackNotification)
当我通过URL获得所有详细信息时,如果我的输入包含特殊字符和数字,它也不包含?标记。
输入:你叫什么名字?输出:你叫什么名字(问号不可用;)
问题我试过这个:
re_path(r'^slackNotification/<str:slack_user_name>/(?P<question>\w+)',views.slackNotification)
输出当前路径与任何网址都不匹配
我想知道我的需求的确切正则表达式?
拉风的咖菲猫
相关分类