V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
python30
V2EX  ›  Python

django url 有什么方法能隐藏网址里的参数? 具体要求说明还请各位进来看吧。

  •  
  •   python30 · 2020-02-28 00:02:45 +08:00 · 2446 次点击
    这是一个创建于 1512 天前的主题,其中的信息可能已经有所发展或是发生改变。
    举个例子,如下 url

    path('play/<int:pk>/<path:play_url>', playurl, name='playurl'),

    这是一个电影播放页面的角析地址,正常情况下,网址是这样的
    http://www.xxxxx.com/111/http://www.bbb.net/xxx.....xxx..m3u8

    这样的网址正丑了

    有什么办法能让这个 url 简洁美好一些不?
    7 条回复    2020-02-28 15:12:50 +08:00
    tyx1703
        1
    tyx1703  
       2020-02-28 00:21:50 +08:00 via iPad
    参数 base64 ?
    a719114136
        2
    a719114136  
       2020-02-28 00:44:25 +08:00 via Android
    那就用 post 呗
    ss098
        3
    ss098  
       2020-02-28 02:17:19 +08:00
    Post 生成一个 ID 存储对应的参数,提供的 URL 相对美观,也能保持 GET 形式。
    BlackBerry999
        4
    BlackBerry999  
       2020-02-28 09:53:58 +08:00
    短 url 了解一下
    python30
        5
    python30  
    OP
       2020-02-28 12:56:16 +08:00
    @tyx1703 嗯。这个方案可行
    python30
        6
    python30  
    OP
       2020-02-28 12:57:17 +08:00
    @a719114136
    @ss098
    能大体说说不?
    用 post 的思路?
    a719114136
        7
    a719114136  
       2020-02-28 15:12:50 +08:00
    把你的 play_url 作为 post 的参数传给后端
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3563 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 04:38 · PVG 12:38 · LAX 21:38 · JFK 00:38
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.