Package: django-hockeydata-api
django_hockeydata_apiA Django package for simple use of Hockeydata Javascript APIhttps://apidocs.hockeydata.net/.RequirementsPython 2.7+, 3.6+Django >= 1.11 (tested with this, earlier versions might work also)For details, seehttps://docs.djangoproject.com/en/dev/faq/install/#faq-python-version-supportInstallationInstall using pip (not available at this time, TODO):pip install git+https://git.wgdnet.de/cwiegand/django_hockeydata_api.gitAlternatively, you can install download or clone this repo and callpip install -e ..Add to INSTALLED_APPS in yoursettings.py:'hockeydata_api',In your templates, load thewidget_tagslibrary:{% load widget_tags %}Example template{% extends "base.html" %}
{% load widget_tags %}

{% block extra_head_content %}
{{ block.super }}<!-- Hockeydata css -->{% hockeydata_css 'los_player_fullpage' %}<!-- custom widget css --><linkhref="{% static 'js/style.css' %}"rel="stylesheet"><!-- Hockeydata javascript -->{% hockeydata_js 'los_player_fullpage' %}<!-- Hockeydata Widget -->{% hockeydata_widget domNode='#player' widgetName='hockeydata.los.Player.FullPage' 
                     divisionId='<yourDivisionId>' playerId=playerId %}
{% endblock %}

{% block content %}<divid='#player'></div>{% endblock %}DocumentationThe Templatetags can receive almost all hockeydata widget options, just write them down in python syntax (e.g. true --> True).
At the moment there is one special option for the game slider widget to get the gameLink parameter from a callback function. This is useful if you want a gameslider for multiple divisions (e.g. for all divsions of an association):{% hockeydata_widget domNode='#gameslider' widgetName='hockeydata.los.GameSlider' 
                     divisionId='<yourDivisionId>' gameLink='/link_to_game/%G/%D' 
                     gameLinkFromCallback=True %}%Gwill be replaced by Game-ID and%Dby Divsion-ID ifgameLinkFromCallbackis true.Some widgets support a callback function, that is called when all javascript
is done and the widget is rendered. Set this option as simple string (e.gpaintinstead ofpaint()). If no javascript function with this name exists,
the option is ignored.hockeydata api documentation:http://apidocs.hockeydata.net/hockeydata widget reference:https://apidocs.hockeydata.net/javascript-api/SettingsThe django-hockeydata-api requires some pre-configured settings.They can be modified by adding a dict variable calledHOCKEYDATAin yoursettings.pyand customizing the values ​​you want;TheHOCKEYDATAdict variable contains these settings:# hockeydata_api settingsHOCKEYDATA={# Hockeydata Api-Key (you can get it from https://apidocs.hockeydata.net/api-key/)'API_KEY':'',# Sport definition key: americanfootball|icehockey'SPORT':'icehockey',# Base-URL to hockeydata static javascript and css'STATIC':'https://api.hockeydata.net/',# Default template: los_template_dark|los_template_glass|los_template_default'DEFAULT_CSS':'los_template_dark',# localization i18n_x_los, where x is the ISO-639-1 language code (de = Germany)# https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes'I18N':'i18n_de_los',}Example appThe example app is created for running with django 2.0!create virtualenvinstall django with 'pip install django'.
Seehttps://www.djangoproject.com/for more information.install django_hockeydata_api as described abovecopy example app to a folder of your choiceset the EXAMPLE_DIV and EXAMPLE_DIV in settings.py to suitable division-idsrun using 'python manage.py runserver'. No database or user is required, so you can skip 'python manage.py migrate'.Bugs and suggestionsIf you have found a bug or if you have a request for additional functionality, please use the issue tracker on GitHub.https://git.wgdnet.de/cwiegand/django_hockeydata_api/issuesLicenseYou can use this under BSD-License. SeeLICENSEfile for details.