add the collector as a management command
This allows the command to be called by cron or a similar external tool
This commit is contained in:
parent
9d01af07b9
commit
03b7cb5325
|
@ -0,0 +1,8 @@
|
||||||
|
from django.core.management.base import BaseCommand, CommandError
|
||||||
|
from collector.collector import values_to_db
|
||||||
|
|
||||||
|
class Command(BaseCommand):
|
||||||
|
help = 'Writes the sense hat values to the db.'
|
||||||
|
|
||||||
|
def handle(self, *args, **options):
|
||||||
|
values_to_db()
|
Loading…
Reference in New Issue