sensors.AFRICA-api
sensors.AFRICA-api copied to clipboard
Sensors app views issues
Accessing views throws "object not callable" error on Django v4 upgrade from v1.
E.g. accessing this v1/data endpoint on a development instance will through this error; raised when calling a bool as a function is_authenticated()
. Of course, removing the brackets works as expected. What baffles me is that this works in the production instance running on Django v1. @thepsalmist would you know anything about this?
@gideonmaina Django deprecates and later remove functionality between major releases e.g. What you're describing sounds similar-ish to https://docs.djangoproject.com/en/4.2/releases/1.10/#using-user-is-authenticated-and-user-is-anonymous-as-methods which was deprecated in Django 1 and removed in Django 2.
If you're planning to upgrade the app, I'd suggest going from one point release to the next e.g. 1.10 to 1.11 to 2.0, etc., or from one LTS release to the next.
My feeling though, we need to rethink everything from scratch e.g. is the platform supports to be just a data store or as a streaming platform, what about security (especially on ingres), etc.
Thanks @kilemensi. I have been using Django 4.2.1 for upgrading the app.
I totally agree we need to rethink the platform from scratch. I have also been trying to wrap my head around the decision to have 2 endpoints. I am aware some of the changes were made to fulfil a partner's requirement to ingest data from other sensor networks. The easiest way to prevent ingestion from anywhere is to enforce model validation using a list of approved nodes.