In this case you need a special trick to keep your errors during the redirect. This will save the errors collection for the next action.
I always try to get the sites I build to validate, and be written in semantically correct markup.
Problem: Vulnerable to Cross-site scripting attacks, because it passes user input directly to the browser.
This may lead to user accounts being hijacked, among other things.
In this particular case, the client wanted to embed (flash) music in his site, something I don’t really like but if it has to be done, it has to be done.
When you have to work with form data submitted by a browser view, code quickly becomes very hard to read.
You can use validation to verify that your models are correct before saving them to the database, or use them directly on HTTP parameters to validate a simple form.
If there are any errors, you will be informed and then you can fix the errors on the spot.
For example, if you are missing a default image, you will have to first add one and then you will be able to upload your ad.
I recommend breaking up the application into multiple modules ( Getting the most out of WTForms with an Extension The Flask-WTF extension expands on this pattern and adds a few little helpers that make working with forms and Flask more fun. Look at the following example template to see how easy this is.
WTForms does half the form generation for us already.