-
Notifications
You must be signed in to change notification settings - Fork 295
Running tapiriik locally
Martin Alvarez-Espinar edited this page Nov 4, 2017
·
16 revisions
Want to run tapiriik without Vagrant?
- Check out the tapiriik repo (the compressed archive will not do)
- From the repo root, run
vagrant up
- Wait while a few hundred megabytes of virtual machine goodness is downloaded
- Take some time to customize the
local_settings.py
file created intapiriik/
. You'll need to fill in the API keys for services you wish to connect to.
-
Start the Django development server
vagrant ssh python /vagrant/manage.py runserver 0.0.0.0:8000
-
Marvel at your shiny new instance of tapiriik available at
http://localhost:8000
-
If you want to run synchronizations, you'll need to run a synchronization worker:
vagrant ssh cd /vagrant/ python ./sync_worker.py
and a synchronization scheduler:
vagrant ssh cd /vagrant/ python ./sync_scheduler.py
While synchronization is possible without the timezone database being populated, there may be errors in synchronized activities' times. Follow the instructions in tz_ingest.py
to populate the database.
- The built-in diagnostics area has a bunch of useful tools for administrating your local copy of tapiriik. I will leave the discovery of the various functionality as an exercise for the reader.
- To get your user ID, shift-click on the tapiriik logo, or click the email link at the bottom of the page (just like the production site, you have to be connected to >=1 service). You can use this to check out details of your specific account by visiting
localhost:8000/diagnostics/user/YOUR_USER_ID
- Automatic synchronization is currently tied to the payment subsystem - just head to
auth/_init_.py
and makeHasActivePayment(user)
always return True - You'll need to change the Strava OAuth return URL (the
redirect_uri
parameter ofUserAuthorizationURL
in strava.py) to match what your API credentials are set up for. Unfortunately (last time I checked) they don't allow localhost, so you may need to send the OAuth return to a different URL and manually replay said request against localhost. - In case of using the Dropbox service, you'll need to create and set up a new app within the Dropbox developers area (
Folder
to access just a folder,Full
to be able to change working folder). In OAuth2, you'll need to configure the redirect URI for Dropbox to know how to continue the authentication process:http://localhost:8000/auth/return/dropbox/normal
(for Folder) andhttp://localhost:8000/auth/return/dropbox/full
(for Full).
- Some services are in the codebase but hidden on tapiriik.com because they are incomplete or not currently functional.
- Some sites require that I not make their integration code open-source (they live in the
private.tapiriik...
modules). If you wish to integrate with these services, please contact them directly.