RESTful API that downloads photos from FlickrAPI and then exposes them at respective endpoints.
-
Clone the repository
-
Install 'virtualenv' to create a virtual environment for our API
pip install virtualenv
-
Setup the virtual environment
virtualenv sample_name_for_virtual_env
-
Activate the virtual environment
sample_name_for_virtual_env\Scripts\activate
-
Install the dependencies
pip install -r requirements.txt
-
Set up the database
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser
-
Run the server (on localhost:8000)
python manage.py runserver
-
Launch the Django shell
python manage.py shell
-
Import the populateDbExample file. (Make sure to add your API key in this file in the appropriate place)
import populateDbExample
-
The database is populated with the provided groups and photos from FlickrAPI.
- End point - api/v1/groups/
Methods allowed - GET
Returns all the groups available in the database.
- End point - api/v1/group/<gid>/
Methods allowed - GET
Returns all the photo ids that are part of the provided group id.
- End point - api/v1/photo/<pid>/
Methods allowed - GET
Returns the data related to a particular photo id.
- End point - api/v1/login/ and api/v1/logout/
Methods allowed - POST
Authentication end points for the REST API.