Skip to content

weberxw/work-at-olist

 
 

Repository files navigation

Olist backend test by Lucas Weber

Description

This is an API for a library to store book and authors data.

For demonstration purposes all user authentication and specific permissions verification has been disabled, so you can access all endpoints without login in.

Dependencies

  • python3.6
  • asgiref==3.2.7
  • dj-database-url==0.5.0
  • Django==3.0.6
  • django-heroku==0.3.1
  • djangorestframework==3.11.0
  • gunicorn==20.0.4
  • pkg-resources==0.0.0
  • psycopg2==2.8.5
  • psycopg2-binary==2.8.5
  • pytz==2020.1
  • sqlparse==0.3.1
  • whitenoise==5.1.0

Import data

To read the authors csv you just need to call python manage.py csv_reader --path 'path_to_csv'

After that the API will import all Authors to the database taking care to not allow duplicate names

Services

Note: You can use a composition of this four filters too using the & character, for example:

ex. https://olistapi.herokuapp.com/library/books/?author="George R. R. Martin"&year=2015

Testing

For testing you just need to call python manage.py test --keepdb library.tests

The keepdb flag preserves the test database between test runs. Increasing the speed to run the tests.

If all went well all tests must have passed.

Environment

This code was developed on a Intel® Core™ i5-7300HQ CPU @ 2.50GHz × 4, 16GB RAM

OS: Linux - Ubuntu 18.04.3 LTS

All python libs were installed inside a virtualenv

If you have any problems or doubts executing this, please call me!

About

Apply for a job at Olist's Development Team: https://olist.gupy.io/

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%