We bring a marketplace and mobile banking to agricultural coops. Check out the wiki to learn more
There are currently two parts to this project. One is a Django web app that deploys to Heroku, and the other is a Python command line simulator for farmer interactions with the SMS server. At the moment, we need to manually add your phone number and you need to be using a Globe phone number to be able to interact with the application using SMS. Hopefully Smart will fix their issues and hopefully Globe will allow us to accept more phone numbers.
- Install Python 2.7 or above (not Python 3.X unfortunately, since django does not support 3.X yet), if you are having trouble in MacOS try these steps
- Install git
- Go to the folder where you want to code (in my examples, I type
cd ~/antportal/
) git clone git@github.com:dannycastonguay/smartcoops.git
python ~/antportal/smartcoops/pilot/smsSimulator.py
curl -O https://raw.github.com/pypa/virtualenv/master/virtualenv.py
python virtualenv.py scenv
source ~/antportal/scenv/bin/activate
pip install django dj-database-url django-extensions psycopg2 pyglobe
(requirements come from the dev center of Heroku)- If you are using MacOS, you might run into trouble with the installation of postgre, if so this article might help you
- Add your ssh key to heroku:
heroku keys:add
- Add heroku to your list of remotes:
git remote add heroku git@heroku.com:tranquil-ocean-3872.git
- (Optional through recommended) set your local db to sqlite (especially if you couldn't get postgres installed propertly configured)
cp farmbook/rename2local_settings4sqlite.py farmbook/local_settings.py
- Change directory to smartcoops (e.g.
cd ~/antportal/smartcoops/
) - Make sure you are in the virtual environment (
source ~/antportal/scenv/bin/activate
) python manage.py syncdb
python manage.py runserver
- Go to
127.0.0.1:8000
or127.0.0.1:8000/admin
- Change directory to sampleSMSCommand directory (e.g.
cd ~/antportal/smartcoops/sampleSMSCommand/
). To test sending SMS messages, modifysms.xml
(orcashVoucher.xml
) and usecurl -d @cashVoucher.xml http://localhost:8000/process/ | grep -A 20 Traceback:
(the| grep -A 20 Traceback:
part is useful if you are debugging)
- Check that the django app runs locally
- From the root of the directory,
git add
the files you have modified git commit -m "some meaningful commit message"
git push
so your changes go to GitHubgit push heroku master
heroku run python manage.py syncdb
- Check that it works by visiting the home page and the admin page (username: danny, password: smartcoopsftw) on Heroku
Assuming that you are running locally:
git pull
python manage.py reset
(anwer yes)python manage.py syncdb
python manage.py shell
(this will load the interactive python command interpreter)import farmbook.scImporter
- Start your server as usual
python manage.py runserver
For the time being, all rights reserved to AntPortal Corp of Canada.