Giter VIP home page Giter VIP logo

xy-inc's Introduction

xy-inc

Projeto para cadastro e recuperação Pontos de Interesse (POI's).

Como criar o ambiente?

  1. Clone o repositório
  2. Crie um virtualenv com Python 3.5
  3. Ative o seu virtualev.
  4. Instale as dependências.
  5. Execute os testes.
  6. Inicialize os dados de teste.
git clone https://github.com/n1lux/xy-inc.git xyinc
cd xyinc
python -m venv .xyinc
source .xyinc/bin/activate
pip install -r requirements.txt
python manage.py makemigrations
python manage.py migrate
python manage.py test
python manage.py initial_data
python manage.py collectstatic

Como executar o servidor

python manage.py runserver

Como testar os serviços

Dados para o envio do json

{
    "name": <string>,
    "x": <int>,
    "y": <int>,
}

No navegador

Para consultar todo os POI's cadastrados

[GET] http://localhost:8000/api/v0/pois/

Para criar um poi

[POST] http://localhost:8000/api/v0/pois/

No campo Media type: application/json

No campo content :
{"name": "teste pois navegador", "x": 45, "y": 20 }

Para buscar os POI's com base nos parametros informados

[GET] http://localhost:8000/api/v0/pois/search/?x=20&y=10&d-max=10

Utilizando curl

Para consultar todos os POI's cadastrados:

curl -X GET -H "Accept:application/json" http://localhost:8000/api/v0/pois/

Para criar um poi:

curl -i -X POST -H "Content-Type:application/json" http://localhost:8000/api/v0/pois/ -d '{"name":"teste poi curl", "x": 25, "y": 10}'

Para buscar os POI's com base nos parametros informados:

curl -X GET -H "Accept:application/json" "http://localhost:8000/api/v0/pois/search/?x=20&y=10&d-max=10"

xy-inc's People

Contributors

n1lux avatar

Watchers

James Cloos avatar  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.