Library REST API with Swagger

by jesuscg


Library REST API with Swagger docs

CircleCI Coverage Status Code Health

This project is intended to handle library books and authors.

This example includes all CRUD operations needed for both models built with the Django Rest Framework. Also, it is documented with a pretty Swagger UI. All requests are made taking care about CORS headers using django-cors-headers django package, making easier testing in localhost.

Getting Started



Clone or fork the repo to your local directory.

For a quick local test, you can install virtualenvwrapper to create a virtual environment.

Install the requirements/local.txt file by using pip inside the virtualenv:

$ cd library-api-swagger
$ pip install -r requirements/local.txt

Create database models:

$ python migrate --settings=config.settings.local

Finally, run the localhost server:

$ python runserver --settings=config.settings.local

Start Example

If you are in a local environment, visit:

  • localhost:8000/api/v1/ to see your browsable API from Django REST Framework interface.

  • localhost:8000/api/v1/docs/ to see Swagger UI documentation scheme.

Running the tests

To execute the application tests, run:

$ cd library-api-swagger/api
$ python test --settings=config.settings.local




This project is licensed under the MIT License - see the file for details.