Robots and sensor journalism are often discussed by digital journalists, but it's rare to see a simple, practical example.
At ONA15 we're bringing together the two with, what we hope, can be a straightforward example for journalists who are curious about the intersection of electronics, programming and reporting. With under $100 in equipment you can build a simple audio sensor that transmits to a server, then processes and stores the data, and runs a simple statistical analysis that powers a twitter "robot."
This readme covers the installation and setup of the server component. For a walkthrough of the electronics portion, including equipment and code for the Arduino, check out our wiki.
Requirements:
- Python
- PostgreSQL
- virtualenv
- Git
Create a virtualenv to store the codebase.
$ virtualenv ona15-arduino-server
Activate the virtualenv.
$ cd ona15-arduino-server
$ . bin/activate
Clone the git repository from GitHub.
$ git clone git@github.com:anthonyjpesce/ona15-arduino-server.git repo
Enter the project and install its dependencies.
$ cd repo
$ pip install -r requirements.txt
You'll need to make a Postgres database locally before you can connect your Django project to it.
$ createdb soundtracker
Make a copy of settings_dev.py and settings_private.py and configure them to connect to your new database.
$ cp project/settings_dev.template project/settings_dev.py
$ cp project/settings_private.template project/settings_private.py
$ vim project/settings_dev.py
Let Django create the database tables you need.
$ python manage.py syncdb
$ python manage.py migrate
Load in some test data, if you want.
$ python manage.py loadtestdata
Run the test server for the first time.
$ python manage.py runserver
Check out the page at localhost:8000