Skip to content

We bring a marketplace and mobile banking to agricultural coops

Notifications You must be signed in to change notification settings

fesp21/smartcoops

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

smartcoops

We bring a marketplace and mobile banking to agricultural coops. Check out the wiki to learn more

Manifest

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.

SMS Simulator Installation

  1. 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
  2. Install git
  3. Go to the folder where you want to code (in my examples, I type cd ~/antportal/)
  4. git clone git@github.com:dannycastonguay/smartcoops.git

Running the Simulator

  1. python ~/antportal/smartcoops/pilot/smsSimulator.py

Django app on Heroku Installation (works with Globe SMS)

  1. curl -O https://raw.github.com/pypa/virtualenv/master/virtualenv.py
  2. python virtualenv.py scenv
  3. source ~/antportal/scenv/bin/activate
  4. pip install django dj-database-url django-extensions psycopg2 pyglobe (requirements come from the dev center of Heroku)
  5. If you are using MacOS, you might run into trouble with the installation of postgre, if so this article might help you
  6. Add your ssh key to heroku: heroku keys:add
  7. Add heroku to your list of remotes: git remote add heroku git@heroku.com:tranquil-ocean-3872.git
  8. (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

Run the django app locally

  1. Change directory to smartcoops (e.g. cd ~/antportal/smartcoops/)
  2. Make sure you are in the virtual environment (source ~/antportal/scenv/bin/activate)
  3. python manage.py syncdb
  4. python manage.py runserver
  5. Go to 127.0.0.1:8000 or 127.0.0.1:8000/admin
  6. Change directory to sampleSMSCommand directory (e.g. cd ~/antportal/smartcoops/sampleSMSCommand/). To test sending SMS messages, modify sms.xml (or cashVoucher.xml) and use curl -d @cashVoucher.xml http://localhost:8000/process/ | grep -A 20 Traceback: (the | grep -A 20 Traceback: part is useful if you are debugging)

Run the django app on heroku

  1. Check that the django app runs locally
  2. From the root of the directory, git add the files you have modified
  3. git commit -m "some meaningful commit message"
  4. git push so your changes go to GitHub
  5. git push heroku master
  6. heroku run python manage.py syncdb
  7. Check that it works by visiting the home page and the admin page (username: danny, password: smartcoopsftw) on Heroku

Starting fresh with new data

Assuming that you are running locally:

  1. git pull
  2. python manage.py reset (anwer yes)
  3. python manage.py syncdb
  4. python manage.py shell (this will load the interactive python command interpreter)
  5. import farmbook.scImporter
  6. Start your server as usual python manage.py runserver

Copyright

For the time being, all rights reserved to AntPortal Corp of Canada.

About

We bring a marketplace and mobile banking to agricultural coops

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 96.6%
  • CSS 1.9%
  • HTML 1.5%