I’ve had a look at the Luftdaten API - definitely possible to fire up a local version to test against.
(I’ve got a version running using
docker-compose - it’s not entirely self contained as you need to manually initialise the DB via command line, but that’s workable with)
@Al_B - The API’s a Django app so you might be familiar with the structure (also uses Redis cache + Postgres db) with some minimal web UI with basic API tests built in.
I haven’t figured out the default login yet and have only started playing with it via the test pages in the app…
…Created my own admin user with CLI:
python manage.py createsuperuser --username admin
then (in the browser) logged in and went to
/admin/ to start setting things up
Not looking great - the web UI doesn’t match the database schema setup in the docker/ docker-compose definitions.
I applied the below to the database to get the pages working:
ALTER TABLE sensors_sensorlocation ADD COLUMN altitude INTEGER NULL;
ALTER TABLE sensors_node ADD COLUMN indoor BOOLEAN NULL;
ALTER TABLE sensors_node ADD COLUMN inactive BOOLEAN NULL;
ALTER TABLE sensors_node ADD COLUMN exact_location BOOLEAN NULL;
but there’s still issues - can’t save a location, so can’t add a sensor definition to submit data against…
/admin/sensors/sensorlocation/add/ - (required to allow a node + sensor to be added via admin) fails with an integer validation error on fields that aren’t integers…
/adddevice/appears to be a public-facing device enrollment form - requires at least one entry to be added via
/admin/sensors/sensortype/, but other than that it looks like it’s supposed to add the rest for you… …but it falls over with a Django
No URL to redirect to. Provide a success_url. error when you submit the form.
Could have saved some time looking at the build errors on that repo:
I don’t think this repo can match what’s running live as it’s broken, which is unfortunate.
we may just need to submit the data to their live system if they let us enroll a sensor.