GithubHelp home page GithubHelp logo

renefs / flask-skeleton Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 612 KB

Skeleton for flask applications using docker for development.

License: Other

Python 51.48% JavaScript 0.56% HTML 44.69% CSS 1.00% Mako 0.99% Dockerfile 1.27%
skeleton docker flask python

flask-skeleton's Introduction

Flask Skeleton

This project contains an skeleton application to be used with Docker Compose and Postgres using volumes for development.

If you don't have a machine, you must create it:

docker-machine create default

And start it:

docker-machine start default

Once started, you can get its information:

docker-machine env default

And set up the environment variables for this machine:

eval "$(docker-machine env default)"

Once done, we can build the project

docker-compose up --build

To access the machine on localhost (needed to use Google Oauth2) it is needed to port forward the 8000 port to the machine's 8000 port. This can be done from Virtualbox: Select the virtual machine -> Settings -> Network -> Advanced -> Port Forwarding:

Name Protoccol Host IP Host Port Guest IP Guest Port
Redirect Port 8000 TCP 127.0.0.1 8000 8000
Redirect Postgres 5432 TCP 127.0.0.1 5432 5432

Once done the machine can be accesed on the following IP:

127.0.0.1:8000

Postgres

To connect to the Postgres Database (password postgres):

psql -h 127.0.0.1 -p 5432 -U postgres --password
CREATE DATABASE <name>;

To view the tables

\dt

To create the tables:

docker-compose run web python main.py --setup

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.