I am about to finish the FLASKFM project but I am stuck in exercise 22.
This is about adding a song to the database by using the form provided.
When I enter any song, I should be able to see it on the list, however, they don’t appear.
Below is the code and not sure what is wrong with it:
@app.route(’/dashboard’, methods=[“GET”, “POST”])
form = SongForm()
if request.method == ‘POST’ and form.validate():
new_song = None
new_song = Song(title = form.title, artist = form.artist, n = 1)
This is the link to the exercise