[Answered ]-Django object filtering with variables

2👍

If you’re getting one instance, you’ll want to use get rather than filter. Try:

Beacon.objects.get(bid=beacon_id)

When you use filter, you’ll return a queryset.

Leave a comment