0
Python flask get-post
Hello, I am a pastebin to make it. I want that when I import text into the textarea that the text will be printed on another page like any pastebin. With get / post requests I guess. This is the python / flask code: http://pastebin.com/nJkjWBdP And this is the html code: http://pastebin.com/zDZC259z Hopefully you can help me. Sincerely, Bliksem
1 Resposta
0
If I understand correctly, you want to create a Pastebin-esque site. So:
You've got a few options:
1. You could save all your POSTee text into some data file or just keep it in a dictionary. When a page is requested, you could simply insert (.format()) the text onto the page. This is a faster and more flexible, but a little bit harder method.
2. The second method is easier but occupies just a tiny bit more space and is not as flexible as the first one. You could literally create and save the page to some directory when it is POSTed. When it's requested, simply serve the file back.