Basic metro models for Django 1.7+, plus the parser that fills models with actual data (lines numbers, lines titles, lines colors, names of the lines, station names) from various data sources (primary - Wikipedia).
Metro models for Django (only for 1.7+), plus the parser that fills models with actual data from various data providers (primary - Wikipedia). This is renamed django-russian-metro package (!).
All russian and cis parsers (like kiev or minsk) respects locale, that’s why for en locale they returns transliterated version of names. Parsers for other cities takes only english names.
Parser downloads the following data:
Also you can run django command sometimes to get always actual data, or use celery task load_metro.
For install django-metro, run on terminal:
$ pip install django-metro
Then add this app to INSTALLED_APPS:
INSTALLED_APPS = ( ... 'metro', ... )
Choose and specify data provider in settings.py:
METRO_PROVIDER = 'moscow'
Finally, fill models with data:
from metro.parser import provider provider.download_all()
Or use celery task load_metro (shared task in tasks.py)
Assign METRO_PROVIDER (in settings.py) one of the values below (source indicated in brackets):
You can rename application title with METRO_APP_TITLE in your settings.py:
METRO_APP_TITLE = u'Saint Petersrburg Metro'
Adopted for django-suit (SortableStackedInline).