Skip to main content

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.

Build Status on travis-ci.org

travis-ci.org/jedie/django-for-runners

Coverage Status on codecov.io

codecov.io/gh/jedie/django-for-runners

Coverage Status on coveralls.io

coveralls.io/r/jedie/django-for-runners

Status on landscape.io

landscape.io/github/jedie/django-for-runners/master

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 Homepage

License

storage directory

leafletjs.com

Leaflet licensed under BSD

for_runners/static/leaflet/

dygraphs.com

dygraphs licensed under MIT

for_runners/static/dygraphs/

chartjs.org

Chart.js licensed under MIT

for_runners/static/chartjs/

Screenshots

(All screenshots are here: github.com/jedie/jedie.github.io/tree/master/screenshots/django-for-runners)

for-runers v0.6.0 2018-07-31 GPX Track.png

for-runers v0.6.0 2018-07-31 GPX Track.png

for-runners v0.4.0 2018-6-26 GPX info.png

for-runners v0.4.0 2018-6-26 GPX info.png

for-runners v0.6.0 2018-07-19 Event Costs.png

for-runners v0.6.0 2018-07-19 Event Costs.png

try-out

e.g.:

# create a python virtualenv:
~$ python3 -Im venv DjangoForRunnersEnv

# activate the created virtualenv:
~$ cd DjangoForRunnersEnv/
~/DjangoForRunnersEnv$ source bin/activate

# Upgrade pip:
(DjangoForRunnersEnv) ~/DjangoForRunnersEnv$ pip3 install --upgrade pip

# install django-for-runners:
(DjangoForRunnersEnv) ~/DjangoForRunnersEnv$ pip3 install git+https://github.com/jedie/django-for-runners.git@egg=django-for-runners

# install dependencies:
(DjangoForRunnersEnv) ~/DjangoForRunnersEnv$ cd src/django-for-runners/
(DjangoForRunnersEnv) ~/DjangoForRunnersEnv/src/django-for-runners$ pip install -r requirements.txt

# create base data:
(DjangoForRunnersEnv) ~/DjangoForRunnersEnv/src/django-for-runners$ ./manage.py fill_basedata

start the development server with the test project, 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

# run the tests:
(DjangoForRunnersEnv) ~/DjangoForRunnersEnv$ cd src/django-for-runners/
(DjangoForRunnersEnv) ~/DjangoForRunnersEnv/src/django-for-runners$ ./setup.py test

# run text via tox:
(DjangoForRunnersEnv) ~/DjangoForRunnersEnv/src/django-for-runners$ ./setup.py tox

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 version

python

v0.5.x

2.0

3.5, 3.6, 3.7

(See also combinations in .travis.yml and tox.ini)

history

  • compare v0.7.0…master dev

    • TBD

  • 02.09.2018 - v0.7.0:

    • Use dygraphs in GPX Track change admin view

    • Sync mouse over from Elevation/Headrate/Cadence dygraphs to leaflet open streep map

    • Fix “try-out” section in README (Thanks adsworth for reporting

    • Add links from gpx tracks to other admin change view

    • Bugfixes

    • internals:

      • refactor stuff around track duration/length

      • move manipluation of list_display and list_filter contributed by adsworth

  • 19.07.2018 - v0.6.0:

    • NEW: event participation

    • NEW: costs of event participation (e.g.: entry fee for the competition, cost of a T-Shirt etc.)

    • NEW: Display statistics of events/costs per user and total

  • 04.07.2018 - v0.5.0:

    • remove Django-CMS

    • update to Django v2.0

    • NOTE: The migrations are simply replaced! So you must delete your database, e.g.: src/django-for-runners$ rm test_project_db.sqlite3

    • Add ‘net duration’ field, for the officially measured time and use it for calculations if available.

    • Create django manage command to fill some base data: $ ./manage.py fill_basedata

    • speedup by deactivating some django debug toolbar panels

  • 26.06.2018 - v0.4.0:

    • combine track filters with statistic views

    • NEW: GPX info (See length, point count and Average distance in meters between the points)

    • NEW: Display GPX metadata

    • Add ‘creator’ to every track and use it as changelist filter

    • remove Streetmap image generated via geotiler

    • Speedup by using a cache for gpxpy instances

  • 23.06.2018 - v0.3.0:

    • Start adding statistics (See screenshot above)

    • add weather information from metaweather.com to every track

  • 21.06.2018 - v0.2.0:

    • Display elevations, heart_rates and cadence_values if available

    • Add kilometer markers to OpenStreetMap

  • 15.06.2018 - v0.1.1:

    • a few bugfixes

  • 15.06.2018 - v0.1.0:

    • Render interactive OpenStreetMap track map with Leaflet JS

  • 12.06.2018 - v0.0.4:

    • Better Events model

    • GPX error handling

    • more tests

    • Bugfix for Python 3.5 (Geotiler needs Python 3.6 or later)

  • 12.06.2018 - v0.0.3:

    • display min/average/max heart rate

    • use autotask to generate the MAP in background

  • 31.05.2018 - v0.0.2:

    • generate SVG ‘icon’ from GPX track

  • v0.0.1 - 30.05.2018

    • Just create a pre-alpha release to save the PyPi package name ;)

credits

The whole thing is based on many excellent projects. Especially the following:

donation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-for-runners-0.7.0.tar.gz (422.8 kB view details)

Uploaded Source

Built Distributions

django_for_runners-0.7.0-py3.6.egg (431.7 kB view details)

Uploaded Source

django_for_runners-0.7.0-py2.py3-none-any.whl (435.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-for-runners-0.7.0.tar.gz.

File metadata

  • Download URL: django-for-runners-0.7.0.tar.gz
  • Upload date:
  • Size: 422.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/32.3.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.3

File hashes

Hashes for django-for-runners-0.7.0.tar.gz
Algorithm Hash digest
SHA256 d2ab2c8f3a956e833ec0427b466df822b115332930e14a296bb2a47ec7332ebd
MD5 39228a57790a8ca9bb9f547bf53dc17a
BLAKE2b-256 37de59be44aa2dad2e62174a61abd24de3a9505ff701f38f7336006d443e17d7

See more details on using hashes here.

File details

Details for the file django_for_runners-0.7.0-py3.6.egg.

File metadata

  • Download URL: django_for_runners-0.7.0-py3.6.egg
  • Upload date:
  • Size: 431.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/32.3.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.3

File hashes

Hashes for django_for_runners-0.7.0-py3.6.egg
Algorithm Hash digest
SHA256 8e25d83ceb132ac4acc533cc544fe2a51a8d5072cae4e7c30a00b0ca53fff450
MD5 00d9c6fa956164f018c68ff26accffeb
BLAKE2b-256 83ff02906f996284567a2eec5134af615a6c9f6f662fd6918b32121ce48f851f

See more details on using hashes here.

File details

Details for the file django_for_runners-0.7.0-py2.py3-none-any.whl.

File metadata

  • Download URL: django_for_runners-0.7.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 435.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/32.3.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.3

File hashes

Hashes for django_for_runners-0.7.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6ed4621e84e61e581c54d12759912d473728ce0a4778875890a95356bb693a6e
MD5 4d53f36c992ca34293437ea47fed24ab
BLAKE2b-256 8f93f642cc73b9537299ff96d14deddc6dfd03c6d1bff6eeab68c0b644f67c3a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page