Skip to content
Peter Adam edited this page Sep 14, 2013 · 6 revisions
  1. Install Dependencies (Debian wheezy):
    apt-get install git python-django apache2 libapache2-mod-wsgi mysql-server python-dateutil python-mysqldb
  2. Fetch trainingslog sources
    git clone https://github.com/p3dda/trainingslog.git
  3. Update settings.py config file:
    • Choose your preferred database backend (I use mysql in this documentation) and change Administrator email address
ADMINS = (
        ('Administrator', 'admin@foo.bar.de'),
)

MANAGERS = ADMINS

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'trainingslog',                      # Or path to database file if using sqlite3.
        'USER': 'tl_user',                      # Not used with sqlite3.
        'PASSWORD': 'tl_pw',                  # Not used with sqlite3.
        'HOST': '127.0.0.1',                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '3306',                      # Set to empty string for default. Not used with sqlite3.
    }
}
  1. Create mysql database and user:
CREATE DATABASE `trainingslog`;
GRANT ALL PRIVILEGES ON `trainingslog`.* TO 'tl_user'@'localhost' IDENTIFIED BY 'tl_pw';
  1. Apache configuration:
<VirtualHost *:80>
	ServerAdmin webmaster@localhost


	Alias /robots.txt /home/trainingslog/trainingslog/static/robots.txt
	Alias /favicon.ico /home/trainingslog/trainingslog/static/favicon.ico

	AliasMatch ^/([^/]*\.css) /home/trainingslog/trainingslog/static/styles/$1

	Alias /media/ /home/trainingslog/trainingslog/media/

	WSGIScriptAlias / /home/trainingslog/trainingslog/wsgi.py

	<Directory /home/trainingslog/trainingslog>
	Order allow,deny
	Allow from all
	</Directory>

</VirtualHost>
  1. Install trainingslog Populate sql database and create superuser:
    python manage.py syncdb

  2. Open your web browser and point it to your trainingslog URL. You should see a login form. Login with your superuser credentials defined in step 6 and proceed with the initial configuration.

  3. Optional configuration in settings.py:

    • Garmin API Key If you want to use Garmin Communicator Plugin (integrated in trainingslog) for direct download of your recorded activities from your Garmin fitness device, you have to request a Garmin API Key and register it in settings.py as tuple with the corresponding domain. Multiple keys can be registered for multi-domain hosting:
GARMIN_KEYS = (('https://trainingslog.p3dda.net', '987bf2e...'),
		('http://trainingslog.example.com', '2132e8...'))
* Facebook APP ID
    If you want to use the 'share on Facebook'-Button, you have to register a corresponding [Facebook App](https://developers.facebook.com/apps) for your trainingslog domains. Configure the generated App ID in `settings.py`:
FACEBOOK_APP_ID = "4393865..."

Facebook App

Clone this wiki locally