正在更改“?”至地址b中的“&”

2024-04-29 18:27:21 发布

您现在位置:Python中文网/ 问答频道 /正文

例如,在我的web应用程序中,我有一个带有url的链接www.example.com/profile?name=名称。当我点击那个链接时,我得到了一个页面,在那里我可以更改个人资料的信息,但是点击那个链接后,地址栏中的url变成了www.example.com/profile&;name=名称。你知道吗

更有趣的是:当我做了一些更改并单击“保存”时,url将恢复为www.example.com/profile?name=名称。你知道吗

如果我没有点击保存,只是刷新页面,我得到错误404。你知道吗

怎么可能呢?你知道吗

p.S我的视图功能

@check_document_access_permission()
def notebook(request, is_embeddable=False):
  if not SHOW_NOTEBOOKS.get():
    return serve_403_error(request)

  notebook_id = request.GET.get('notebook', request.GET.get('editor'))

  is_yarn_mode = False
  try:
    from spark.conf import LIVY_SERVER_SESSION_KIND
    is_yarn_mode = LIVY_SERVER_SESSION_KIND.get()
  except:
    LOG.exception('Spark is not enabled')

  return render('notebook.mako', request, {
      'editor_id': notebook_id or None,
      'notebooks_json': '{}',
      'is_embeddable': request.GET.get('is_embeddable', False),
      'options_json': json.dumps({
          'languages': get_ordered_interpreters(request.user),
          'session_properties': SparkApi.get_properties(),
          'is_optimizer_enabled': has_optimizer(),
          'is_navigator_enabled': has_navigator(request.user),
          'editor_type': 'notebook'
      }),
      'is_yarn_mode': is_yarn_mode,
  })

Tags: name名称comurlgetis链接mode