-
Notifications
You must be signed in to change notification settings - Fork 1
Installation
Peter Adam edited this page Sep 14, 2013
·
6 revisions
- Install Dependencies (Debian wheezy):
apt-get install git python-django apache2 libapache2-mod-wsgi mysql-server python-dateutil python-mysqldb - Fetch trainingslog sources
git clone https://github.com/p3dda/trainingslog.git - 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.
}
}
- Create mysql database and user:
CREATE DATABASE `trainingslog`;
GRANT ALL PRIVILEGES ON `trainingslog`.* TO 'tl_user'@'localhost' IDENTIFIED BY 'tl_pw';
- 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>
-
Install trainingslog Populate sql database and create superuser:
python manage.py syncdb -
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.
-
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.pyas tuple with the corresponding domain. Multiple keys can be registered for multi-domain hosting:
- 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
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..."
