【问题标题】:django issue with url receive from API从 API 接收的 django 问题
【发布时间】:2021-05-15 14:26:32
【问题描述】:

以下是来自 API 的重定向链接 我想渲染我的 urls.py

http://127.0.0.0:8000/test-pay-redirect?token=60257a578aedc20bd1a6892c&mode=popup&tap_id=chg_TS014820212148r1N41102850

re_path(r"^test-pay-redirect/",views.paytestredirect,name='test_pay_redirect'),

path("test-pay-redirect/",views.paytestredirect,name='test_pay_redirect'), 我都试试 但它无法连接到这个网址

【问题讨论】:

  • 这两个命令看起来都不错。问题可能出在其他地方!?

标签: python django api url


【解决方案1】:

我为您创建了一个简单的演示项目。 https://github.com/michaelhaar/Answer-for-Stackoverflow-66160632

运行python manage.py runserver命令并访问http://localhost:8000/test-pay-redirect/?token=60257a578aedc20bd1a6892c&mode=popup&tap_id=chg_TS014820212148r1N41102850

您应该会看到如下内容:

【讨论】:

    【解决方案2】:

    请尝试删除您的 url 路由中的尾部斜杠!?

    path("test-pay-redirect", views.paytestredirect, name='test_pay_redirect')
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-23
      • 1970-01-01
      • 2017-10-12
      • 2021-07-16
      • 1970-01-01
      • 2016-06-15
      • 2021-07-06
      • 2016-11-08
      相关资源
      最近更新 更多