Giter Club home page Giter Club logo

flask-seed's Introduction

Flask-Seed

Flask-Seed is an opinionated boilerplate for your next Flask app. It uses the best practices, so you don't have to.

Stack

First-Time Setup

Flask-Seed runs natively on Linux and OSX in a virtual environment, using Virtualenv. To get it up an running, follow these steps:

  1. Generate secrets files, using good secret keys:

    cp config/example.secrets.py config/secrets.py
    vim config/secrets.py
  2. Change all the CHANGEMEs. You should be able to run this command without seeing any output:

    grep -rn CHANGEME .
  3. Install MongoDB (Ubuntu Linux, OSX).

    On OSX, you may have to run mkdir /data /data/db before you can run mongod without errors.

  4. Install VirtualEnv:

    sudo pip install virtualenv
  5. Install SASS gem gem install sass

    Otherwise, you will see an intermittent OSError

Developing

./develop.sh                    # MongoDB, virtualenv, and Pip
source bin/activate             # Enter the virtual environment
python run.py                   # Run the application

Finally, go to localhost:5000 in your web browser.

Testing

Tests live in the test directory, and can be run via nosetests. We also use flake8 for linting .py files.

First, enter your development environment. See "Developing" for more. Then, run the tests:

flake8 app config test          # Run the flake8 linter on our python files
nosetests --with-progressive    # Run test scripts

Organization / Structure

.
├── app              # All code related to the running of the app
│   ├── forms        # Flask-WTForms models, used for generating forms in 
│   │                #     HTML and validating input
│   ├── lib          # Misc helpers, tasks, and modular libraries
│   ├── models       # Mongoengine Models
│   ├── routes       # All Flask routes, using Blueprints
│   ├── static       # Static files.  Note: All files in here are public
│   │   ├── css      # CSS
│   │   │   ├── lib  # CSS libraries
│   │   │   └── gen  # CSS generated from SCSS
│   │   ├── img      # Images
│   │   ├── js       # JavaScript files
│   │   └── scss     # Stylesheets
│   ├── templates    # HTML templates
│   └── __init__.py  # All app-wide setup.  Called by `run.py`
├── config           # Configuration files
├── develop.sh       # Used for non-Vagrant local Development
├── run.py           # Runs the app!
└── test             # Unit tests

flask-seed's People

Contributors

schlosser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

flask-seed's Issues

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.