Go to the Python website and install Python 3.7 or 3.8
3.9 does not work!
Type pip install -r requirements.txt
to install other dependencies
Open your console and navigate to the directory.
Navigate into the folder petsite.
If it is your first time running the site.
Run python manage.py migrate
and python manage.py createcachetable
Otherwise,
Run python manage.py runserver
or py manage.py runserver
Go to your browser and put in the address http://127.0.0.1:8000/petfinder
Set up new environment variables: PETFINDER_KEY , PETFINDER_SECRET_KEY , PETSITE_SECRET_KEY, MAPBOX_API_KEY The values for the variables can be found in the google drive folder.
https://www.computerhope.com/issues/ch000549.htm
Open terminal
Run “nano ~/.bash_profile”
Scroll to the bottom of the file and add these four lines, replacing <key>
and <secret key>
with the key you're given
export PETFINDER_KEY=<key>
export PETFINDER_SECRET_KEY=<secret key>
export PETSITE_SECRET_KEY=<secret key>
export MAPBOX_API_KEY=<key>
Type “CONTROL+X”, then “Y” and “enter”
Restart your ide or terminal and the variables should be setup properly
Run the tests for test_html.py before this test (search.json must have something in it). Using Pytest either in Pycharm or Terminal you can run every test in the file tests/test_query.py or individual tests.
Tests can also be run with Pytest inside of tests/test_default.py and tests/test_types_breeds.py
Each test is its own function inside of the file starting with the word ‘test’.
Information on how to use Pytest in Pycharm can be found here: https://www.jetbrains.com/help/pycharm/pytest.html#enable-pytest and Pytest documentation for terminal commands can be found here: https://docs.pytest.org/en/stable/usage.html.
The current supported tests, test the basic functionality of retrieving petfinder data. As we add the functionality for searching for specific criteria in future iterations, other tests in the suite will be added, testing said criteria (ie. a test exhausting the location formats when we work on a user story involving location)
In order to test the new descript modals feature, run test_full_info_window.py. After the actions take place, you should be able to interact with the map and and click on the clusters. You should be able to scroll through the popup to see the pets in that location. Click on any of the "More information" buttons, and you will see a modal popup with a bigger picture of the dog, as more information about the dog.