Adding an input form for new crimes

We want the user to be able to specify more information than simply a location. The next step is to create a form that the user can use to add date, category, and description data to a crime submission. Each of these pieces of information will be stored in the database columns we created in the previous chapter. Creating web forms is a common enough task that there are many frameworks and plugins to help automate as much of the process as possible, as most forms need a pretty frontend, which includes error messages if the user puts in unexpected input, as well as backend logic to process the data and do a more thorough validation to prevent malformed or incorrect data from polluting the database.

However, in ...

Get Flask: Building Python Web Services now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.