Keep all functionality for (parsers + db + frontend API) inside one Django project.
Suggested components:
-
Parser yields datapoints based on call with varname and frequency. Can yield random values for a prototype.
-
Import broker calls parser and stores datapoints in database.
-
Database stores datapoints. For simlicity overwrite existing datapoints with newer ones.
-
End user API allows querying database to by varname/frequency
Simplifications:
- No time limits
- Same API to enduser and to parser
virtualenv -p python3.6 minikep
source /minikep/bin/activate
git clone https://github.com/mini-kep/full-app.git full-app
cd full-app
pip install -r requirements.txt
python manage.py runserver
If you are not using virtual environment with defined python version 3.6 you need to follow this command:
python3 manage.py runserver
http://localhost:8000/auth/login/?next=/
user: admin
pass: asdasdasd
http://localhost:8000/api/datapoints/
http://localhost:8000/api/
Run tests:
python manage.py test
You can look to api/tests to check how CRUD works for Datapoint
It's a simple Django Rest Api project.
Project has one model: minikep.api.models.Datapoint.
The model has appropriate serializer: minikep.api.serializers.DatapointSerializer
This view takes data from the model to API for CRUD operations:
minikep.api.views.DatapointViewSet
Global Django settings for whole project: Minikep.minikep
Now project works with sqlite, so you can easy install it locally and check how it works.
Project work with continuous integration service. Now it works with dev branch. It run all tests before deploying changes on Git. .travis.yml - main configuration file for Travis
https://rocky-ridge-15355.herokuapp.com/api/
user: admin
pass: asdasdasd