Skip to content

duyledat197/python-init-code

Repository files navigation

Backend API Web Service

Documentation

Postman collection: https://documenter.getpostman.com/view/5341276/S1LwzTNg?version=latest

Prerequisites

  • Python 3.7
  • Postgres

Development Tool:

  • pip8: Python formatter

Development Setup

  1. Install dependencies:
pip install requirements.txt
  1. Setup .env file
virtualenv -p `which python3` .venv
source .venv/bin/activate
pip install -r requirements.txt
  1. Setup database
postgresql
  1. (Optional) access Postgres database
psql "postgresql://:@localhost:5432/<db_name>"
  1. Set up redis

  2. (Optional) access Redis database

redis-cli -h 127.0.0.1 -p 6379 -n 0
  1. Start Celery worker:
python main_celery.py worker --loglevel=info -Ofair --beat
  1. Start project
python main.py

Deploy server

Run with docker

  1. Setup docker
  • install docker
  • install docker-compose
  • install make
  1. Start project
make deploy-server
  1. Set config to database
docker exec -it <docker container api> python manage.py seed_all

About

python code init in backend

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published