[Fixed]-ValueError at /music/4/favorite/ invalid literal for int() with base 10: ''

1👍

Your input is using {{ songs.id }}. It should be {{ song.id }}.

<input type="radio" id="song{{ forloop.counter }}" name="song" value="{{ song.id }}">

Rendering your own inputs is error-prone, like in this case. If you use Django forms it decreases the chance of mistakes.

Leave a comment