简体   繁体   English

使用 python 为我的网站创建临时网页

[英]creating temporary webpages using python for my website

I have a website with nothing on it and I am trying to create a python program that someone can launch, and create a temporary page on my website, so for example my website is example.com and it would create website.com/aw34ed with a random url extension, and if someone were to enter the temporary webpage it would send data to the python program where ever that person is running it.我有一个没有任何内容的网站,我正在尝试创建一个 python 程序,有人可以启动它,并在我的网站上创建一个临时页面,例如我的网站是 example.com 它将创建 website.com/aw34ed一个随机的 url 扩展名,如果有人要进入临时网页,它将向该人运行的 python 程序发送数据。 I would also like the temporary website extension/page to delete itself and not exist after a certain amount of time.我还希望临时网站扩展/页面自行删除,并在一定时间后不存在。

I understand this question is kind of vague so am I kind of wondering what I would use to do this and how difficult this would be to create我知道这个问题有点含糊所以我有点想知道我会用什么来做这个以及创建它会有多困难

You could use Flask variables (as this answer states: https://stackoverflow.com/a/63839730/15447633 ).您可以使用 Flask 变量(如该答案所述: https://stackoverflow.com/a/63839730/15447633 )。

@app.route('/temp/<id>')
def show_temp_page(id):
    # some method for getting the temporary page, perhaps a db lookup

I have a website with nothing on it and I am trying to create a python program that someone can launch, and create a temporary page on my website, so for example my website is example.com and it would create website.com/aw34ed with a random url extension, and if someone were to enter the temporary webpage it would send data to the python program where ever that person is running it.我有一个网站,上面什么都没有,我正在尝试创建一个有人可以启动的 python 程序,并在我的网站上创建一个临时页面,例如我的网站是 example.com,它将创建 website.com/aw34ed一个随机的 url 扩展,如果有人要进入临时网页,它会将数据发送到 python 程序,无论那个人正在运行它。 I would also like the temporary website extension/page to delete itself and not exist after a certain amount of time.我还希望临时网站扩展/页面在一定时间后自行删除并且不存在。

I understand this question is kind of vague so am I kind of wondering what I would use to do this and how difficult this would be to create我知道这个问题有点含糊,所以我有点想知道我会用什么来做这件事以及创建这将有多么困难

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM