GithubHelp home page GithubHelp logo

flask-empty's Introduction

Flask Empty

Flask-Empty is a simple flask skeleton project for fast flask prototyping. Just clone de project and copy the example you like the most.

Usage

Clone the repository. In src/ folder, copy somewhere else the flask-version example that you want to work with. Rename the folder to your project name. Change configurations to your needs and have fun! = ]

Configuring

src/config.py has some pre-configured flask configuration classes for you. They're are all self explanatory. Dev is used by default with the runserver command, while Testing is used only when running tests. Config is a more general configuration. You can extend any of these classes to create your production config or some other special configuration.

Note that the Flask-Script option, -d (disable debug) does not work as expected in Flask-Empty. If you want to start a non-debug internal server instance, use the config.Config configuration or write your own. Example:

# loads config.Config configuration, which has DEBUG=False
# -r is the Flask-Script option for internal server no-reload
python manage.py -r -c Config

If environment config named APP_CONFIG is set (as explained here http://flask.pocoo.org/docs/config/#configuring-from-files), it is used and overwrites any other set configuration.

Templates

There are some error templates bundled with flask-empty by default. All empty right now. Just fill them up for your project.

Blueprints

Add your blueprints through the src/config.ConfigClass.BLUEPRINTS. A blueprint can be added using the path to the associated Blueprint instance like blog.views.app where blog.views are the module path and app is the variable name.

SQLAlchemy

Flask-Empty comes with some Flask-SQLAlchemy configurations ready for you. Just uncomment some lines in your main.py and database.py files.

ps: your models will only be created if they are imported somewhere in your application. By somewhere, try the same module where your Blueprint instance is defined.

Examples

If my explanation above is as crappy as I think it is, you're gonna want/need to take a look at examples/. They are a very nice starting point to learn how to configure your project.

flask-empty's People

Contributors

italomaia avatar

Watchers

James Cloos 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.