oway.org.il - Crowd-sourced road hazard reporting website.
Feel free to contribute to the project. It is currently hosted on Heroku: http://anyway.herokuapp.com
To report bugs and feature requests, please open an issue on GitHub.
See also our Android app on GitHub.
- We try to follow the process of other Hasadna projects, e.g. Open-Knesset
- Fork this repository on GitHub
git clone https://github.com/*you*/anyway
- Add the main repository as your upstream remote:
git remote add upstream https://github.com/hasadna/anyway
- Get updates whenever you start working:
git pull upstream master
- Push to your fork when you've committed your changes and tested them:
git push
, and make a pull request from your fork on GitHub
sudo apt-get install python-pip python-dev libpq-dev
sudo easy_install pip setuptools
- Install postgresql:
brew install postgresql
(after installing brew)
sudo pip install virtualenvwrapper
- Add to your
~/.bashrc
:source /usr/local/bin/virtualenvwrapper.sh
mkvirtualenv anyway
cd anyway
pip install -r requirements.txt
- Each time you start working:
workon anyway
- Install Python 2.7
- Install setuptools & pip(package manager) and update PATH to python and python/scripts directories (e.g.
PATH=%PATH%;C:\Python27\Scripts
) - Install VC2008 Express (alt: mingw)
- Install GitHub for windows and get the code
cd
to the anyway directorypip install -r requirements.txt
- If any package fails to install, download it from here and install it using
pip install <package>
. If this fails, you might have to download thewin32
package, even if you are on a 64-bit platform.
- Define connection string (needs to be defined whenever you start working):
- bash:
export DATABASE_URL='sqlite:///local.db'
- windows shell:
set DATABASE_URL="sqlite:///local.db"
- First time, create tables:
python models.py
- Optionally, get the complete accidents file after sending a permission request, and extract it into
/static/data/lms
. Otherwise you'll use the example accidents file that you already got with the code, so no need to get it again. - Populate the data (markers etc.):
python process.py
: this will take less than an hour if you're using the example files (default), but if you have the complete data it may take several days. Be prepared. - Run the app:
python main.py
: do this whenever you start working and want to try out your code. - Browse to http://127.0.0.1:5000
It is useful to add the following to your ~/.bashrc
(fixing for the correct path):
alias anyway='cd *path*/anyway && workon anyway && export DATABASE_URL=sqlite:///local.db'
Then you can simply start working by running the anyway
command.
PyCharm is recommended for development.
- Create an account on Heroku
- Install the Heroku toolbelt
- Follow the quickstart instructions. On step #4, read the Python introduction
- Create an app, e.g. anyway-you
- Sign up for a free Heroku Postgres add-on (note that you'll have to enter your credit card details to be eligible):
heroku addons:add heroku-postgresql:hobby-dev
- Push from your Git repository to Heroku
- Populate the database with the data (assuming you have it in your local directory):
- Copy the database URL from your Heroku config:
heroku config:get DATABASE_URL
(if you have several apps, specify the relevant one with the option--app <anyway-*you*>
for any Heroku command) - Create tables:
python models.py
- Populate data:
python process.py
- Copy the database URL from your Heroku config:
- Browse to http://anyway-*you*.herokuapp.com