GithubHelp home page GithubHelp logo

flask-api-test's Introduction

Flask API Test

Purpose

A basic Flask API that implements CRUD operations using Flask-RESTX and stores data in a PostgreSQL server. Interaction with the database is done using SQLAlchemy. Flask-RESTX also allows for the creation of swagger documentation for the API.

Setup

Environment Variables

Copy the .env-template file, and rename the copy .env. This file will store environent variables for configuring the API (these values will be assigned in the sections below).

Python Setup

Create a new virtual environment named .venv, activate it with source .venv/bin/activate, and install dependencies with _install_requirements

Postgres Setup

Specify the postgres configuration such as IP/domain, port, user, password, etc. in .env.

Once all environment varaibles have been set, run source .env in order to export all environment variables

Scripts

  • _activate_environment

    • exports environment varaibles in .env and activates the virtual environment
    • Important: must be run like so: . ./_activate-environment
  • _export_requirements

    • used to export current dependencies to requirements.txt
  • _gunicorn_start

    • starts gunicorn using config file
  • _install_requirements

    • used to install all dependencies from requirements.txt
    • should be run inside the virtual environment
  • _start_dev_server

    • starts the api

flask-api-test's People

Contributors

ctffarley avatar dependabot[bot] 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.