Giter Site home page Giter Site logo

urschrei / flask-bootstrap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dansimau/flask-bootstrap

1.0 4.0 1.0 504 KB

Bootstrap a Flask project on Ubuntu Precise, with Puppet, Vagrant and Fabric.

Python 6.81% Puppet 2.83% Ruby 86.32% JavaScript 4.04%

flask-bootstrap's Introduction

A Flask app skeleton in a Virtualbox VM, built using Vagrant, including:

Quickstart

  • Ensure that Virtualbox and Vagrant are installed
  • This setup assumes a 64-bit capable system – it should run on a precise32 box instead, but I haven't tried
  • Clone this repository (you may wish to clone it without any history — git clone --depth 1 repo_url)
  • cd into the newly-cloned repo, and run git submodule update --init
  • Create and boot the VM: vagrant up
  • Wait a while – Vagrant may have to download a precise64 box, and the Python requirements installation will be slow on the initial run – maybe you'd like to go for a quick wander, talk to a cat &c.
  • SSH to the VM: vagrant ssh

From within the VM, you can now

  • Run your app, which will then be reachable from localhost on 0.0.0.0:5000: fab run_app

  • Run an iPython shell with a test request context and imported models: fab shell

  • Run, list, and create alembic migrations, including auto-generation:

    fab upgrade_db:optional revision
    fab downgrade_db:revision
    fab show_migrations
    fab revision:"Message"
    fab autogenerate:"Message"

Notes

Be aware that auto-generation of migrations has some limitations.

You should check that the versions of the packages currently present in requirements.txt match your requirements, and update / amend them if necessary. Currently, the most recent version of each package is being installed, and I'm not aware of any incompatibilities.

The Bootstrap and Javascript components which are installed are detailed in assets.yml, and are present in the static directory. Your application's JS should be placed in the app.js file. Refer to the webassets documentation for details of how to use and customise the package.

You can connect to the database using e.g. PGAdmin from your local machine by connecting to:

localhost port 15432
db: app_db
user: flask_user
pass: flask_pass

From within your VM, you can connect using the same credentials on port 5432.

Todo

  • Fix the zip download submodule problem

flask-bootstrap's People

Contributors

dansimau avatar urschrei avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

drcongo

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.