V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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 · Feb 28, 2020 · 3006 views
    This topic created in 2253 days ago, the information mentioned may be changed or developed.
    举个例子,如下 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 replies    2020-02-28 15:12:50 +08:00
    unsized
        1
    unsized  
       Feb 28, 2020 via iPad
    参数 base64 ?
    a719114136
        2
    a719114136  
       Feb 28, 2020 via Android
    那就用 post 呗
    ss098
        3
    ss098  
       Feb 28, 2020
    Post 生成一个 ID 存储对应的参数,提供的 URL 相对美观,也能保持 GET 形式。
    BlackBerry999
        4
    BlackBerry999  
       Feb 28, 2020
    短 url 了解一下
    python30
        5
    python30  
    OP
       Feb 28, 2020
    @tyx1703 嗯。这个方案可行
    python30
        6
    python30  
    OP
       Feb 28, 2020
    @a719114136
    @ss098
    能大体说说不?
    用 post 的思路?
    a719114136
        7
    a719114136  
       Feb 28, 2020
    把你的 play_url 作为 post 的参数传给后端
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5144 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 69ms · UTC 08:33 · PVG 16:33 · LAX 01:33 · JFK 04:33
    ♥ Do have faith in what you're doing.