I want web users to input specific words to the form on my website, and I want to let my class or function in model.py process the input data to generate a picture. Then implement the generated picture on the result page shown after pushing the submit button.
There are 2 questions about this.
How do I connect Form and my function?
and how do I implement png from a directry to html?
if you help me in detail, that is very nice.
You can simply throw related documents, URL, and the name of importable things or library at me. That might largely help me out as well.
thank you very much.
Hey there - for this kind of basic question, you would be best following the Django tutorial or the DjangoGirls tutorial - they will teach about forms and how to connect them to functions.
Then, to handle pictures, you will have to understand how to have Django send non-text responses - you’ll need to pass raw binary data and a custom mimetype to Response, and then you can send anything you like. I recommend you try with a fixed picture first before you generate one.
If you have specific questions, I’m happy to try and help, but your initial open-ended question is too large for any one person to help without giving full instruction!
Thank you for helping, those replies made me able to convince myself of that my plan was actually feasible.