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.
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 manage.py migrate --settings=config.settings.local
Finally, run the localhost server:
$ python manage.py runserver --settings=config.settings.local
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.
To execute the application tests, run:
$ cd library-api-swagger/api $ python manage.py test --settings=config.settings.local
This project is licensed under the MIT License - see the LICENSE.md file for details.