An open source micro-volunteering app, allowing individuals and groups to create and keep track of small tasks.
Improvements and pull requests are welcome. If you have problems with these instructions, please raise an issue.
- Python 2.6 or above (but < Python 3)
- easy_install
- You may need Python's developer package ("python-dev" or "python-devel")
sudo apt-get install python python-setuptools python-dev
# clone the repo
cd DESINATION_DIRECTORY
git clone git@github.com:dharmafly/tasket.git
cd tasket
# install virtualenv
easy_install virtualenv
# if this fails, use: sudo easy_install virtualenv
# activate virtualenv
virtualenv --no-site-packages .
source bin/activate
# install required Python libraries
easy_install pip
pip install -r requirements.txt
# create the local settings config file
cd web
cp local_settings.py.example local_settings.py
Tasket is set up for quick testing and development using SQLite as its database. For deployment, edit web/local_settings.py and change the ENGINE
setting to Postgres or similar.
Tasket allows its behaviour to be modified, via a number of settings in local_settings.py. (TODO: document these settings)
It is recommended to create a superuser account during this process (follow the instructions in the terminal).
# in the /web folder
python manage.py syncdb
python manage.py migrate
python manage.py loaddata ../server/tasks/fixtures/test_data.json
python manage.py runserver
cd tasket
source bin/activate
cd web
python manage.py runserver
Go to http://localhost:8000 to see the running app.
When pulling in new changes, there may have been new models added, or changes made to the existing models. After a git pull run the following:
python manage.py syncdb
python manage.py migrate
If you created a superuser account (recommended) when syncdb was run above, you can now log in to the django admin interface by going to http://localhost:8000/admin/
To enable emailing (see below), you must edit the site 'Domain name' and 'Display name' at /admin/sites/site/1/
On Linux, if you find that images in the app are not successfully processed after upload (with a 500 Server Error for each image request), there may be a problem where the Python Image Library (PIL) cannot find the correct path to JPEG and other image libraries. To resolve it, follow the steps in this article.
For further info, see this article and Issue #110.
Step-by-step instructions for deploying to WebFaction have been included here: https://github.com/dharmafly/tasket/blob/master/docs/INSTALL-WebFaction.md
We use smoosh to package the JavaScript for production. To get it, you need Node.js >= 0.4.0.1 and npm installed.
Then install Smoosh:
npm install smoosh -g
To package the JavaScript, run Smoosh from the build folder:
cd client/media/tank/build/
smoosh -c ./config.json
This will run JSHint against the codebase and write tasket.js and tasket.min.js in to the client/media/js/build/pkg/ directory.
NOTE: Ignore any JSHint warnings for header.js and footer.js, as these are partial JavaScript files used to enclose the Tasket application in a function closure.
By default, the minified, packaged JavaScript will be served when the app is viewed in a browser. To enter debug mode, and to immediately see any changes you make to the JavaScript files, add ?debug
to the URL in the browser address bar (add it before the #hash), e.g. http://localhost:8000/?debug#/hubs/
[TODO: add notes to the doc about loader.js and re-Smooshing when adding a new file to loader.js]
The DEBUG
flag in /web/localsettings.py is set to True
by default, for ease of local development. This flag should be set to False
on deploy.
It's recommended to run the task_states
management command every so often.
This does 2 things:
- If a task has been claimed but not done within
settings.CLAIMED_TIME_LIMIT
(default 24 hours) then the task state is reverted to 'new' - If a task has been done but not verified then it is automatically verified
after
settings.DONE_TIME_LIMIT
(default 24 hours)
To run this command at 10 minutes pass every hour, add the following to your crontab:
10 * * * * python [path/to/]web/manage.py task_states
NOTE: If you are using virtualenv, make sure you activate it before running the command.
In order to send forgotten password emails, a valid SMTP server will need to be set in web/local_settings.py. The two main settings are EMAIL_HOST
and EMAIL_PORT
.
For testing, these can be set to localhost
and 1025
and the following run from the command line:
python -m smtpd -n -c DebuggingServer localhost:1025
All email that Django sends will then me piped to stdout on the terminal where the above was issued.
For more information on various Django email settings that can be added to local_settings.py, see:
- http://docs.djangoproject.com/en/1.3/topics/email/
- http://docs.djangoproject.com/en/1.3/ref/settings/
To complete the email settings, edit the site 'Domain name' and 'Display name' in the admin panel, at /admin/sites/site/1/
An email template can be created in web/templates/password_reset_email.html It's best to copy the template from server/frontend/templates/password_reset_email.html and edit it to fit your needs.
- 'task admins' – users that can perform various admin operations using the front end (such as editing any task or hub).
- 'super users' – users that can log in to the Django backend and edit other users (to make them a 'task admin', for example).
Task admins will have access to edit and delete any task or project, as if it was their own. Additionally, they have the power (and are encouraged) to verify (or reject) any Done tasks.
Only 'superusers' can login to the Django admin. You should avoid creating more superusers than strictly necessary, as they will have access to all the app's data, with the power to delete or cause a mess. Superusers should only use Django to change the admin rights of other users.
Do NOT delete projects (called "Hubs") or tasks from within Django – do that via the app itself, otherwise there will be broken references between items in the database. Similarly, do not delete users from within Django (currently there is no way to do this via the app).
To login as a superuser, go to http://yourdomain.com/admin/ in a browser. You'll need the same username and password as your login to the app (you may already be logged in).
(The user must already have created an account by signing up within the app).
Log in to Django and go to http://yourdomain.com/admin/tasks/profile/ (or click through the navigation). Click on the user you want to edit. Click the 'Admin' checkbox and 'Save' the user.
Log in to Django and go to http://yourdomain.com/admin/auth/user/ (or click through the navigation). Click on the user you want to edit. Check both the 'Superuser' and 'Staff' checkboxes and 'Save' the user.
A superuser should have been created when the site was installed. If no superuser exists, running the following will create a one:
python manage.py createsuperuser
The Tasket server runs as a simple JSON API, allowing innovation in the client apps that consume it. API documentation can be found at: https://github.com/dharmafly/tasket/blob/master/docs/api.md
The Tasket repository on GitHub uses two main branches, 'master' and 'release'. The release branch always contains a production-ready version of Tasket, ready to be deployed to a live server. The master branch is the latest development version of Tasket, containing any recent stable updates.
When developing new functionality for Tasket, consider creating local development branches for each feature. When complete, these changes should be committed and merged into the 'master' branch. Once these updates have been tested and verified as ready for release, they should be merged into the remote 'release' branch.
This approach allows new features to be added to Tasket while maintaining a version of the app in a deployable state at all times.
To set up the master/release branches via the command line:
# setup new branches so that git-pull(1) will appropriately merge from the remote branch
git config branch.autosetupmerge true
# setup a local release branch to track the remote release branch
git branch --track release origin/release
# merge changes from master into the release branch
git checkout release
git merge master