Skip to content

morristech/tasket

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tasket

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.

Dependencies

  • Python 2.6 or above (but < Python 3)
  • easy_install
  • You may need Python's developer package ("python-dev" or "python-devel")

To install these dependencies on Linux:

sudo apt-get install python python-setuptools python-dev

Install Tasket

# 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

Optional: customise web/local_settings.py

Change the database engine

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 behaviour

Tasket allows its behaviour to be modified, via a number of settings in local_settings.py. (TODO: document these settings)

Prepare the database

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

Optional: Load test data

python manage.py loaddata ../server/tasks/fixtures/test_data.json

Start the server

python manage.py runserver

In future, you can start the server like this

cd tasket
source bin/activate
cd web
python manage.py runserver

Go to http://localhost:8000 to see the running app.

Updating Tasket

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

Django admin

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/

Troubleshooting: images served with 500 Server Error

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.

Deploying Tasket to a public server on WebFaction

Step-by-step instructions for deploying to WebFaction have been included here: https://github.com/dharmafly/tasket/blob/master/docs/INSTALL-WebFaction.md

Building a single minified JavaScript file

Build software installation

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

Building the JavaScript file

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.

Debugging and developing the JavaScript

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]

Debug mode in the web server

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.

Cron

It's recommended to run the task_states management command every so often.

This does 2 things:

  1. 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'
  2. 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.

Email

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:

Set the site name in Django Admin

To complete the email settings, edit the site 'Domain name' and 'Display name' in the admin panel, at /admin/sites/site/1/

Email template

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.

Admin users

There are two types of Tasket admins:

  1. 'task admins' – users that can perform various admin operations using the front end (such as editing any task or hub).
  2. '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

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.

Superusers

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).

Changing a normal user into a task admin

(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.

Changing a normal user into a superuser

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.

Troubleshooting: when no superusers exist

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 API

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

Branches and workflow

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

About

A micro-volunteering app, for crowd-managed tasks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 86.9%
  • Python 13.1%