API web application to show list of hotels given a location and coordinates
- open cmd or terminal, run this command if you don't have virtual environment on your machine > pip install virtualenv
- create a virtual environment > virtualenv env
- Activate the virtual environment
- Firstly, clone or download the github repository > https://github.com/gyrationtechs/nearhotel.git
- I am assume you are familiar with working with virtual environment and command prompt
- to clone the repository run this command > 'git clone https://github.com/gyrationtechs/nearhotel.git'
- initialize a virtual environment on the repository you created, activate the virtual environment
- run the command to install all library used > pip install -r requirements.txt
- run the command > python manage.py migrate (to create database tables)
- Before running > python manage.py runserver read the API Docs
- Rename the .env-example file to .env and replace the API_KEY Variable with the key gotten from the here API
- This project uses Here API for geocoding, near places, and mapView, to access the API you will need to provide an API_KEY on the .env file.
- Go to > https://developer.here.com and sign up for a free developer account, create a project and navigate to your dashboard
- Open the service you created and click on Create API_KEY, copy the key and paste the code in the .env file, replace YOUR_API_KEY with the value from the here dashboard
- Once all configurations are set, you can run the command > python manage.py runserver
- By default, you access the web app through > localhost:8000
- From the homepage, click on the get Started button, it will redirect you to the api form page
- Enter the addres you wish to get nearby hotels for.
- It posts the data and returns a list of 5 hotels close to the specified location, as well as returning the map and coordinates for the specified location
- To alter the result, change the near_hotels function, alter the limit parameter in the url variable to your desired value
- The web application is hosted remotely on heroku and can be accessed through the link below Demo: https://nearbyhotel.herokuapp.com