Giter Site home page Giter Site logo

flask-rest-api's Introduction

flask-rest-api Build Status

A flask-driven restful API for Bucketlist interactions

Technologies used

  • Python3 - A programming language that lets you work more quickly (The universe loves speed!).
  • Flask - A microframework for Python based on Werkzeug, Jinja 2 and good intentions
  • Virtualenv - A tool to create isolated virtual environments
  • PostgreSQL โ€“ Postgres database offers many advantages over others.
  • Minor dependencies can be found in the requirements.txt file on the root folder.

Installation / Usage

  • If you wish to run your own build, first ensure you have python3 globally installed in your computer. If not, you can get python3 here.

  • After this, ensure you have installed virtualenv globally as well. If not, run this:

        $ pip install virtualenv
    
  • Git clone this repo to your PC

        $ git clone [email protected]:gitgik/flask-rest-api.git
    
  • Dependencies

    1. Cd into your the cloned repo as such:

      $ cd flask-rest-api
      
    2. Create and fire up your virtual environment in python3:

      $ virtualenv -p python3 venv
      $ pip install autoenv
      
  • Environment Variables

    Create a .env file and add the following:

    source venv/bin/activate
    export SECRET="some-very-long-string-of-random-characters-CHANGE-TO-YOUR-LIKING"
    export APP_SETTINGS="development"
    export DATABASE_URL="postgresql://localhost/flask_api"
    

    Save the file. CD out of the directory and back in. Autoenv will automagically set the variables. We've now kept sensitive info from the outside world! ๐Ÿ˜„

  • Install your requirements

    (venv)$ pip install -r requirements.txt
    
  • Migrations

    On your psql console, create your database:

    > CREATE DATABASE flask_api;
    

    Then, make and apply your Migrations

    (venv)$ python manage.py db init
    
    (venv)$ python manage.py db migrate
    

    And finally, migrate your migrations to persist on the DB

    (venv)$ python manage.py db upgrade
    
  • Running It

    On your terminal, run the server using this one simple command:

    (venv)$ flask run
    

    You can now access the app on your local browser by using

    http://localhost:5000/bucketlists/
    

    Or test creating bucketlists using Postman

flask-rest-api's People

Contributors

gitgik avatar

Watchers

James Cloos avatar Luis Gustavo 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.