[Answered ]-Django invalid literal for int() with base 10 get_prep_value

2๐Ÿ‘

โœ…

I think you have incorrectly passed the stage object instead of stage.pk as argument in url template tag in the index.html page.

Try changing

{% url 'autostages:detail' stage %}

to

{% url 'autostages:detail' stage.pk %}

Actually, when you were passing stage object as the argument, then its representation which you have defined in your model i.e. stage_number was being used as the value of the argument. S1 not being an integer led to the error.

๐Ÿ‘คRahul Gupta

0๐Ÿ‘

Normaly You have this issue when you trying to add or read data with int field models in your case verify that value field receive only positive small int

๐Ÿ‘คMbambadev

Leave a comment