Skip to content
Server for the Fair Work Mechanical Turk script
Python HTML CSS JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
auditor
fairwork_server
static
staticfiles
.gitignore
LICENSE
Procfile
README.md
manage.py
requirements.txt
runtime.txt

README.md

Fair Work server

You can run this server independently if you'd like to maintain data privacy for the Fair Work script.

Make sure to edit settings, typically by creating a local_settings.py and importing settings. A sample starter might include:

from fairwork_server.settings import *

DEBUG = True
SECRET_KEY = 'createarandomstringandputithere'
TIME_ZONE = 'America/Los_Angeles' # or your timezone

ALLOWED_HOSTS = []

EMAIL_HOST = '' # email server so you can send notifications from the platform, e.g., SendGrid
EMAIL_HOST_USER = '' # username
EMAIL_HOST_PASSWORD = '' # password
EMAIL_PORT = 587
EMAIL_USE_TLS = True

ADMIN_NAME = "Fair Work Debug"
ADMIN_EMAIL = "youremailaddress@domain.com"
ADMINS = [(ADMIN_NAME, ADMIN_EMAIL), ]

WORKER_IRB_TEMPLATE = 'placeholder-irb-worker.html' # for your IRB agreement
REQUESTER_IRB_TEMPLATE = 'placeholder-irb-requester.html' # for your IRB agreement

HOSTNAME = 'https://fairwork.yourdomain.com' # used as the hostname in emails sent by the system, since Django management commands do not know the server's hostname

Starting the server

python manage.py runserver --settings=fairwork_server.local_settings

Or using localhost HTTPS, assuming that you've already generated a self-signed .crt and .key file (here, localhost.crt and localhost.key):

python manage.py runsslserver --settings=fairwork_server.local_settings --certificate ../localhost.crt --key ../localhost.key

Auditing HIT payment

Collect completed HITs --- run this hourly:

python manage.py pullnotifications --settings=fairwork_server.local_settings

Check for underpayments and send requesters a notification of pending payments --- run this daily:

python manage.py auditpayments --settings=fairwork_server.local_settings

Send the payments to workers after requesters have had time to read the email --- run this daily, 12hr after the auditpayments command:

python manage.py payaudits --settings=fairwork_server.local_settings
You can’t perform that action at this time.