Code Monkey home page Code Monkey logo

lokimotestdjango's Introduction

Lokimo API Test

Why

Made to answer the Lokimo Job Offer,

Usage

  • To run the app, you'll need to have docker installed and run the command docker compose up

  • The result should be an API exposed to request on the port defined in the .env file, for this readme its 4789

  • To feed the DB, use docker exec -it lokimo_app python manage.py importdata

  • API exposed at : http://127.0.0.1:4789/swagger/ , only on debug configuration. As you'll see, I created the endpoints by respecting REST guidelines.

Search

Commune

Using any tool you want :

127.0.0.1:4789/ad/search?city=44009,44047 will return ads in the city 44009 or 44047 127.0.0.1:4789/ad/search?city=44009 will return ads in the city 44009

But due to django capabilities, it works with any first order property of the model.

Thus 127.0.0.1:4789/ad/search?city=44009,44047&iris=440090101 works as well

Radius

The search by radius is just another criteria in the 'ad/search' API : 127.0.0.1:4789/ad/search?x=47.2155884&y=-1.4653951&r=500

Will works and you can compose this parameters with the previous ones

Average Summary

The average report re-uses the search mecanism but changes the report :

127.0.0.1:4789/ad/summary?x=47.2155884&y=-1.4653951&r=500

works as well as 127.0.0.1:4789/ad/summary?city=44009,44047&iris=440090101

Tests :

Link to postman for API testing :

Run in Postman

lokimotestdjango's People

Contributors

pazka avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.