CommCare HQ is a server-side tool to help manage community health workers. It seamlessly integrates with CommCare mobile and CommCare ODK, as well as providing generic domain management and form data-collection functionality.
- CommCare application builder
- OpenRosa compliant xForms designer
- SMS integration
- Domain/user/CHW management
- Xforms data collection
- Case management
- Over-the-air (ota) restore of user and cases
- Integrated web and email reporting
- submodules/ - submodule reference to the meat of the code (which lives in many other packages, particularly core-hq)
- libs/ - Third party libs (presumably python) that you'll need to reference
- scripts/ - Any helper scripts you'll want to write to deal with data and or other things. This stuff should probably run outside the scope of the python environment
Please note, these instructions are targeted toward UNIX-based systems.
The following are necessary for the basic function of CommCare HQ.
python
pip
memcached
- postgres - Download postgres here
- couchdb - Download couchdb here
It is recommended that you create the database commcarehq before continuing.
It is recommended that you create the database commcarehq before continuing.
A virtualenv is not required, but it may make your life easier.
To install:
sudo pip install virtualenv # or sudo easy_install virtualenv
mkdir ~/.virtualenvs/
virtualenv ~/.virtualenvs/commcare-hq --no-site-packages
Run source ~/.virtualenvs/commcare-hq/bin/activate
to enter your virtualenv.
We use our own flavor of Twitter Bootstrap for our user interface.
Please check the README on our HQ Bootstrap project page for requirements and instructions.
Most notably, you will need lessc
and uglify-js
to compile HQ Bootstrap.
Once all the requirements are in order, please do the following:
git clone [email protected]:dimagi/commcare-hq.git
cd commcare-hq
git submodule update --init --recursive
source ~/.virtualenvs/commcare-hq/bin/activate # enter your virtualenv if you have one
pip install -r requirements.txt
cp localsettings.py.example localsettings.py
Make the necessary edits to localsettings.py (database passwords, email configuration, etc.). Things to note:
- Make sure the postgres settings match your expectations (for instance, the postgres user password likely needs to be changed from the ***** in the file)
- Make sure the CouchDB settings match your expectations
- Make sure the following lines are correct and that the directories exist and are accessible by your user. Feel free to change the paths to your liking. DJANGO_LOG_FILE = "/var/log/datahq/datahq.django.log" LOG_FILE = "/var/log/datahq/datahq.log"
Please make sure you're still in the root directory of commcare-hq and that you are inside the correct virtualenv (if you are using one).
./manage.py syncdb
./manage.py migrate
# this will do some basic setup, create a superuser, and create a project
./manage.py bootstrap <project-name> <user> <password>
./manage.py make_bootstrap # (if it fails add the 'direct-lessc' directive)
./manage.py collectstatic
memcached -d
Enable Lucene settings in settings.py (to view case list in the Report section)
./manage.py celeryd -v 2 -B -s celery -E
In order to build and download a CommCare mobile app from your instance of CommCare HQ, you need to follow our instructions for how to download and load CommCare binaries from the Dimagi build server: https://github.com/dimagi/core-hq/blob/master/corehq/apps/builds/README.md
If an import isn't working it may well be because we aren't specifying all versions in the requirements.txt and you have an old version. If you figure out this problem and figure out what version we should be using, feel free to add it to requirements.txt as ">=ver.si.on" like so: couchdbkit>=0.5.2 (Use == for exact version instead of lower bound.)