We pulled from the Boston Crime data set located on the boston.gov website. We were fortunate that the dataset was clean so we did not have to format the data further. When the user fills out the location form all the data points are passed through the URL parameters, and the crime database is filtered based on the user's safety requirements indicated by the checkboxes. The database is then iterated through into a python dictionary which is passed to MapQuest as a JSON object of crime points to avoid along with the start and end location. Map Quest then returns to Django another JSON object which contains various navigation information and step by step directions. We then parsed through that data and iterate over it into our HTML template.
Open your command line and navigate to the folder you want to install the program.
mkdir Safe-Route-Home
virtualenv .
https://github.com/christinagee/Safe-Route-Home
git clone https://github.com/christinagee/Safe-Route-Home
cd Safe-Route-Home
pip install -r requirements.txt
python manage.py runserver
Once you run the program in your terminal, click on the link http://127.0.0.1:8000/, or the link posted in the terminal.
You will be directed to the website, and can navigate through the website via the home page, about, team, and readme pages (where you are now!).
The inputs the webpage gets is location a, b, and events to avoid. You will not need to input any other data or files.
If you ever return to the file to run the program again, go to the Safe-Route-Home folder, and in your terminal, activate your virtual environment by writing:
source bin/activate