ошибку при прорисовки формы в шаблоне:
Reverse for 'sensortoroom' with no arguments not found. 1 pattern(s) tried: ['sensortoroom/(?P[0-9]+)$']
сама форма:
template
<form action="{% url 'addsensor' %}" method="post">
{% csrf_token %}
{{form.as_p }}
<button type="submit">Save</button>
</form>
urls.py
urlpatterns = [
...
path('sensortoroom/<int:room_id>', sensortoroom, name='sensortoroom'),
...
]
view.py
def sensortoroom(request, room_id):
room = Rooms.objects.filter(id=room_id)
return render(request, 'room/addsensortoroom.html', {'room': room})