Simple Django App to pull data from http://www.mvg-live.de and to store them in the Database. The Name of the stations can be configured via the Admin UI and there is a Admin command to pull the data via Cron.

views.py 316B

123456789
  1. # -*- coding: utf-8 -*-
  2. from __future__ import unicode_literals
  3. from django.shortcuts import render
  4. from .models import DepartureTime
  5. def departures(request, ):
  6. my_times = DepartureTime.objects.all().filter(product='S-Bahn').order_by('time')
  7. return render(request, 'dash/mvg.tpl.html', {'times': my_times})