Using Django with real‑time IoT sensor data, has anyone tried this?

Welcome @ariajames !

First, for background - I’ve done a lot of this in the past.
If you search this forum for

It’s not clear to me from your description which direction the requests occur.

If the microcontroller is sending the data as an http request, then your Django view for that url is an ordinary view. There’s nothing special or different that need to be done for it.

If it’s capable of sending data through other means, then that may be worth investigating.

On the other hand, if your project needs to issue the requests to retrieve the data from the server, then you want to do this external to your Django project - perhaps as a Django management command.

Another issue is to consider how frequently you need to retrieve the data.

Don’t forget to check for other connectivity options if you’re needing to pull this data more frequently than (roughly) every 5 seconds.

The design of the models is not affected by this at all. What the controller sends and what you want to keep are the only factors involved, and again, it’s just standard Django.

It depends upon the rate at which updates need to be retrieved and presented to the browser. I’ve worked with devices feeding data at 100ms cycles (10 / second) - those required websockets for live data feeds. But for devices requesting data evey 5 - 10 seconds, then you can consider polling.

There are some other factors to consider regarding the “locality” of the devices to the server and the relative locality of the server to the browsers. You may also need to consider how many browsers are going to be connecting to view this data and how it needs to be presented on the browser.