-
Notifications
You must be signed in to change notification settings - Fork 3
Developer Guide
Clone the project source code:
% git clone https://github.com/rapidpro/chatpro.git
Install Python dependencies:
% cd chatpro
% virtualenv env
% source env/bin/activate
% pip install -r pip-requires.txt
Create the PostgreSQL database (enter password nyaruka when prompted):
% createdb chatpro
% createuser chatpro -P -E
% psql -c "GRANT ALL PRIVILEGES ON DATABASE chatpro to chatpro;"
Link up the development settings file
% ln -s chatpro/settings.py.postgres chatpro/settings.py
Sync the database adding all the models:
% python manage.py syncdb
Create our superuser account. Note that ChatPro forces a user's username to be always be the same as their email address, so for simplicity it's best to ensure this is true also for the superuser:
% python manage.py createsuperuser
At this point everything should be good to go, you can start with:
% python manage.py runserver
To run background tasks, you'll also need to start celery:
% celery -A chatpro worker -B -l info
% coverage run --source="." manage.py test --verbosity=2 --noinput
% coverage report -m --include="chatpro/*" --omit="*/migrations/*,*/tests.py"
ChatPro uses subdomains to determine which organization a user is currently accessing. For example, if you create an organization with the subdomain testing, you should configure that as an alias for localhost. On a UNIX-like system you would edit /etc/hosts as follows:
127.0.0.1 localhost testing.localhost
The default development settings file connects to rapidpro.io. To integrate with a different RapidPro instance, either edit this file or create a new settings file.