This file explains how to set up and run the project by hand.
See the DEPLOY
file for a suggested way of doing this on a remote server.
For licensing (BSD 3-clause), see COPYING
.
# Create settings.py for Django:
cd schedulesite/schedulesite
cp settings_dev.py.template settings.py
# Set the SECRET_KEY in settings.py to some random string.
# Set CALENDAR_DOMAIN and TEST_CALENDAR_ID to the calendar to make events on.
cd -
npm install
PATH=./node_modules/.bin:$PATH bower install --config.interactive=false
Choose your Database by editing settings.py
.
If you choose PostgreSQL
then run createdb futuschedule
.
Make a Python virtual environment however you prefer, then:
pip install -r req.txt
./schedulesite/manage.py migrate
You need a project in the Google Developers Console. Download its
client-secrets.json
from there.
The first time the code needs Google OAuth, it looks for client-secrets.json
in your current directory, prints a URL for you to authorize the app and get
an access token in the URL fragment at the end.
Credentials are stored in a_credentials_file
in your current dir.
Trigger this e.g. by running the unit tests (see below).
Get a JSON dump of FUM users (you need an API token for FUM)
go run dump-fum-users.go -o users.json «AccessToken»
Create Django users from this dump:
./schedulesite/manage.py shell
import futuschedule.util
futuschedule.util.updateUsers('users.json')
./schedulesite/manage.py shell
import futuschedule.util
futuschedule.util.updateMeetingRooms()
PATH=./node_modules/.bin:$PATH jsx --no-cache-dir schedulesite/futuschedule/static/futuschedule/js/src schedulesite/futuschedule/static/futuschedule/js/build
./schedulesite/manage.py test futuschedule
./schedulesite/manage.py migrate
# compile JSX files to plain JavaScript; JS files are copied unchanged
PATH=./node_modules/.bin:$PATH jsx --watch schedulesite/futuschedule/static/futuschedule/js/src schedulesite/futuschedule/static/futuschedule/js/build
# Start the webserver:
REMOTE_USER=myusername ./schedulesite/manage.py runserver
# Start the task-processor (kill with Ctrl+C (SIGINT) or SIGTERM):
./schedulesite/manage.py shell < task-processor.py