Giter Site home page Giter Site logo

django-api's Introduction

Django Small API

Small API that lets you perform CRUD operations. Its main focus is the management of occurrences.

Available endpoints

Endpoint Method Description
/occurences POST Create a occurrence
/occurences GET Get all occurrences
/occurences/{id} GET Get a occurrence
/occurences/{id} PUT Update occurrence
/occurences/{id} DELETE Delete occurrence

For more detailed documentation you can run the following command to generation the documentation.

make api_docs

After it's done, you can access the documention at ./docs/web/index.html

Setup

Before starting, you will need to have docker installed in your computer. If you have postman installed it will help you to test and make request to the API.

You can start the API by simply run the following command.

make setup_api

Because it's the first time, this command will build all the necessary images and then will spin up the containers. After that it will create the database, run migrations and make your database up to date.

If it's not the first time you can simply run:

make start_api

This command will only spin up the containers, so if you want to run migrations you will need to run:

make migrate_db

Usage

When the setup is done you can now safely browse localhost:8000 and explore the API.

There is one other option (better one) to explore the API. You can test it using this Postman collection, you just need to import it to your Postman and it's ready to use.

The endpoints are in order, so you can make the first request to create one Occurrence, then you can make request to get all Occurrences and so on.

Tests

To run tests you just need to do:

make tests

Other commands

You can see the list of commands by running:

make help

If there is some cache problem you can clean it by running:

make clean_cache

If you want to get inside the container you can run:

make hijack

django-api's People

Contributors

pedro-mealha 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.