Giter Site home page Giter Site logo

miguepoloc / sistemas_inteligentes_backend Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 142 KB

Backend for project Sistemas Inteligentes

Home Page: https://sistemas-inteligentes-backend.1.us-1.fl0.io

Dockerfile 2.18% Python 92.73% HTML 5.09%
django django-rest-framework docker iot

sistemas_inteligentes_backend's Introduction

Stack for Django Projects by Miguel Polo

Features

  • Swagger and postman are used for documentation

Requirements

  • Docker
  • docker-compose

Run

Setup

  1. Clone repository:

Run With Docker

  1. Copy .env.example to .env and custom:
  • cp .env.example .env
  1. docker-compose
  • docker-compose -f docker-compose.dev.yml build
  • docker-compose -f docker-compose.dev.yml up

Run With Virtualenv

  1. Copy .env.example to .env and custom:
  • cp .env.example .env
  1. Create virtualenv and activate
  • python -m venv venv
  • source venv/bin/activate (Linux)
  • ./venv/Scripts/activate (Windows)
  1. Install requirements
  • pip install -r /requirements.txt
  1. Run
  • cd src
  • python manage.py runserver

Migrations With Docker

With Docker

  • docker-compose -f docker-compose.dev.yml run --rm django sh -c "python manage.py makemigrations"
  • docker-compose -f docker-compose.dev.yml run --rm django sh -c "python manage.py migrate"

With Virtualenv

  • cd src
  • python manage.py makemigrations
  • python manage.py migrate

Create new app

With Docker

  • docker-compose -f docker-compose.dev.yml run --rm django sh -c "python manage.py startapp appname"

With Virtualenv

  • cd src
  • python manage.py startapp appname

Test

With Docker

  • docker-compose -f docker-compose.dev.yml run --rm django sh -c "python manage.py test"

With Virtualenv

  • cd src
  • python manage.py test

Test coverage

With Docker

  • docker-compose -f docker-compose.local.yml run --rm django sh -c "coverage run --source=. manage.py test --noinput"

To see the report:

  • docker-compose -f docker-compose.local.yml run --rm django sh -c "coverage report"

To generate html report:

  • docker-compose -f docker-compose.local.yml run --rm django sh -c "coverage html"

With Virtualenv

  • cd src
  • coverage run --source=. manage.py test --noinput

To see the report:

  • coverage report

To generate html report:

  • coverage html

Linter

Use pre-commit to run linter before commit, the command is:

  • pre-commit run --all-files

sistemas_inteligentes_backend's People

Contributors

miguepoloc avatar alexespinosa98 avatar

Stargazers

 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.