Store your GPX tracks of your running (or other sports activity) in django.
Project description
Store your GPX tracks of your running (or other sports activity) in django.
The name Django-ForRunners has the origin from the great Android tracking app ForRunners by Benoît Hervier: http://rvier.fr/#forrunners
We collect some JavaScript files, for easier startup. These files are:
Project |
License |
storage directory |
---|---|---|
Screenshots
for-runners v0.3.0 2018-6-23 Distance Statistics.png
for-runners v0.2.0 2018-6-21 Change GPX Track.png
v0.0.1 2018-5-30
try-out
e.g.:
# create a python virtualenv: ~$ python3 -Im venv DjangoForRunnersEnv # activate the created virtualenv: ~$ cd DjangoForRunnersEnv/ ~/DjangoForRunnersEnv$ source bin/activate # Upgrate pip: (DjangoForRunnersEnv) ~/DjangoForRunnersEnv$ pip3 install --upgrade pip # install django-for-runners: (DjangoForRunnersEnv) ~/DjangoForRunnersEnv$ pip3 install -e git+https://github.com/jedie/django-for-runners.git@master#egg=django_for_runners # install dependencies: (DjangoForRunnersEnv) ~/DjangoForRunnersEnv$ cd src/django-for-runners/ (DjangoForRunnersEnv) ~/DjangoForRunnersEnv/src/django-for-runners$ pip install -r requirements/tests.txt
start the development server, e.g.:
# activate the virtualenv: ~$ cd DjangoForRunnersEnv/ ~/DjangoForRunnersEnv$ source bin/activate # start server: (DjangoForRunnersEnv) ~/DjangoForRunnersEnv$ cd src/django-for-runners/ (DjangoForRunnersEnv) ~/DjangoForRunnersEnv/src/django-for-runners$ ./run_test_project_dev_server.sh
import GPX files, e.g.:
# activate the virtualenv: ~$ cd DjangoForRunnersEnv/ ~/DjangoForRunnersEnv$ source bin/activate # import: (DjangoForRunnersEnv) ~/DjangoForRunnersEnv$ cd src/django-for-runners/ (DjangoForRunnersEnv) ~/DjangoForRunnersEnv/src/django-for-runners$ ./manage.py import_gpx --username <username> ~/backups/gpx_files
Note: It is no problem to start import_gpx with the same GPX files: Duplicate entries are avoided. The start/finish (time/latitude/longitude) are compared.
run tests
# activate the virtualenv: ~$ cd DjangoForRunnersEnv/ ~/DjangoForRunnersEnv$ source bin/activate # import: (DjangoForRunnersEnv) ~/DjangoForRunnersEnv$ cd src/django-for-runners/ (DjangoForRunnersEnv) ~/DjangoForRunnersEnv/src/django-for-runners$ ./setup.py test
Note:
To run all tests, you need:
Chromium Browser WebDriver e.g.: apt install chromium-chromedriver
Firefox Browser WebDriver aka geckodriver
install geckodriver e.g.:
~$ cd /tmp /tmp$ wget https://github.com/mozilla/geckodriver/releases/download/v0.20.1/geckodriver-v0.20.1-linux64.tar.gz -O geckodriver.tar.gz /tmp$ sudo sh -c 'tar -x geckodriver -zf geckodriver.tar.gz -O > /usr/bin/geckodriver' /tmp$ sudo chmod +x /usr/bin/geckodriver /tmp$ rm geckodriver.tar.gz /tmp$ geckodriver --version geckodriver 0.20.1 ...
some notes
GPX storage
Currently we store the unchanged GPX data in a TextField.
Precision of coordinates
GPX files from Garmin (can) contain:
latitude with 29 decimal places
longitude with 28 decimal places
elevation with 19 decimal places
The route on OpenStreetMap does not look more detailed, with more than 5 decimal places.
See also: https://wiki.openstreetmap.org/wiki/Precision_of_coordinates
Django compatibility
django-for-runners |
Django CMS |
django version |
python |
---|---|---|---|
v0.x.x |
3.4.x TLS |
1.11 TLS |
3.5, 3.6 |
(See also combinations in .travis.yml and tox.ini)
Note: Maps can’t generated with Python 3.5 (Geotiler needs Python 3.6 or later)
TODO:
Add real tests
Support Django CMS v3.5 and run tests against these versions.
Support Django v2.0 and run tests against these versions.
history
-
Start adding statistics (See screenshot above)
add weather information from metaweather.com to every track
-
Display elevations, heart_rates and cadence_values if available
Add kilometer markers to OpenStreetMap
-
a few bugfixes
-
Render interactive OpenStreetMap track map with Leaflet JS
-
Better Events model
GPX error handling
more tests
Bugfix for Python 3.5 (Geotiler needs Python 3.6 or later)
-
display min/average/max heart rate
use autotask to generate the MAP in background
-
generate SVG ‘icon’ from GPX track
v0.0.1 - 30.05.2018
Just create a pre-alpha release to save the PyPi package name ;)
links
Homepage |
|
PyPi |
alternatives (OpenSource only)
https://github.com/pytrainer/pytrainer (Desktop Program)
https://github.com/GoldenCheetah/GoldenCheetah/ (Desktop Program)
Online tools:
credits
The whole thing is based on many excellent projects. Especially the following:
gpxpy GPX file parser
Leaflet JS A JS library for interactive maps used to render the track on OpenStreetMap
Chart.js HTML5 Charts
geotiler Generate streetmap images
geopy Get geo location names of the GPX track start/end point
matplotlib plotting 2D graphics
autotask schedule background jobs
svgwrite Generating SVG file
donation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for django_for_runners-0.3.0-py3.6.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54080006213ef24bf176b7a3391abc8358f51b66ea635863ae32b2d5c84a42e0 |
|
MD5 | 9b32ea3ac94af4e5c1b65a75f4862ad9 |
|
BLAKE2b-256 | 5b79e02ea357b8286cf51638d4fa00817c9f1a3ca0177fdd880c3e5ea9f9be90 |
Hashes for django_for_runners-0.3.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4649795065a2b7cc0ad67b9f524e70392a11f4cce0b2efdaf6321e951c6be5be |
|
MD5 | 29afe5823e01dc7d41a722046fdd378c |
|
BLAKE2b-256 | cb3d1a78a5f98ca6e3e56121946ccbfdbaf16d4c71e06bab7345cd421b778033 |