[Answered ]-Django: If form doesn't have information set value to

1👍

You set this default value in frontend. In your html:

<option selected="selected">
1d
</option>

I would argue that it is the better option.

You can of course check for empty string in the interval keyword

if request.POST["interval"] == "":
    interval = "1d"
👤ErikR

Leave a comment