[Answer]-Creating a set of radio buttons from a context

1👍

You should use {{ variable_name }}. Like this:

<form>    
{% for x in y %}
    <label><input type="radio" name="group1" value="{{ x }}">{{ x }}</label><br>
{% endfor %}

What happened is that you didn’t use Django template sintax and just wrote a valid html label, hence the x in the radio buttons

👤Alvaro

Leave a comment