Code Monkey home page Code Monkey logo

project's Introduction

Project

https://github.com/TarasSavchyn/project.git

API for an application for leaving comments on the Django Rest framework, such technologies as Swagger, JWT Tokens, Docker, PostgreSQL are used.

Content

Technologies

Documentation

http://127.0.0.1:8000/api/schema/swagger-ui/

http://127.0.0.1:8000/api/schema/redoc/

Using

Clone the repository from GitHub:

$ git clone https://github.com/TarasSavchyn/project.git

Once you've cloned the repository, navigate into the repository.

Create a virtual environment and activate it using the following commands:

$ python3 -m venv venv
$ source venv/bin/activate

In directory backend create file ".env" with the following content:

SECRET_KEY=django-insecure-5=6$k7w$$q_ks=zh%(!oer=$x=7*(cq)pxdpin@@koppqepe_6

POSTGRES_HOST=abul.db.elephantsql.com
POSTGRES_DB=ryhsjbpf
POSTGRES_USER=ryhsjbpf
POSTGRES_PASSWORD=Vjv0cg9zL4NpkbxTWaExXk6wkD5rt0L-

project/backend$ : Backend:

$ pip install -r requirements.txt
$ python3 manage.py migrate
$ python3 manage.py runserver

Docker

In directory create file ".env" with the following content:

SECRET_KEY=django-insecure-5=6$k7w$$q_ks=zh%(!oer=$x=7*(cq)pxdpin@@koppqepe_6

POSTGRES_HOST=abul.db.elephantsql.com
POSTGRES_DB=ryhsjbpf
POSTGRES_USER=ryhsjbpf
POSTGRES_PASSWORD=Vjv0cg9zL4NpkbxTWaExXk6wkD5rt0L-

After that create the file "docker-compose.yml"

version: "3.4"

services:
  backend:
    image: savik1992/project-backend:latest
    ports:
      - "8080:8080"
    command: sh -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8080"
    env_file:
      - .env
    depends_on:
      - db
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U habrpguser -d habrdb"]
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 10s
  db:
    image: postgres:14-alpine
    env_file:
      - .env

Then open your terminal and navigate to the directory you wish to store the project and run the following commands:

$ docker-compose up

Welcome, the application is ready to use at url http://localhost:8080/api/app

Project developers

project's People

Contributors

tarassavchyn 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.