Coder Social home page Coder Social logo

python-rest-api's Introduction

A simple rest API with flask

Prerequisites

If you haven't done yet, create a virtual env

python3.11 -m venv .venv

Dependencies

Install poetry

pip install -U pip setuptools
pip install poetry

See instructions for shell autocomplete.

Install deps

poetry install --no-root

Types & Code style

Static type checking

poetry run mypy .

Code formatting

poetry run black .

Docker

Build local docker images

docker-compose build

Run dev containers

docker-compose up

Migrations

setup initial migrations

flask db init

generate migration files

flask db migrate

apply migration

flask db upgrade

DotEnv File

You will need to create and file a '.env' file. Here are sample values:

MAILGUN_API_KEY=
MAILGUN_DOMAIN=
REDIS_PASSWORD=VfpFtOFGxx0BRYJ6WH5IZNEWBzcuZtJ9
TASK_QUEUE_REDIS_URL=redis://:VfpFtOFGxx0BRYJ6WH5IZNEWBzcuZtJ9@redis-queue:6379
USE_BACKGROUND_WORKER=true
POSTGRES_USER=POSTGRES_USER
POSTGRES_PASSWORD=POSTGRES_PASSWORD
POSTGRES_DB=POSTGRES_DB
DATABASE_URL=postgresql://POSTGRES_USER:POSTGRES_PASSWORD@db:5432/POSTGRES_DB
FLASK_APP=pythonrestapi/application.py
FLASK_ENV=development
JWT_SECRET_KEY=
PYTHON_REST_API_CONFIG_FILE=config/config_test.py
ENV_NAME=test

python-rest-api's People

Contributors

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