skip to navigation
skip to content

Flask-Turbo-Boost 0.0.11

Forked Flask-Boost - Flask application generator for boosting your development.


.. image::
:alt: Latest Version
.. image::
:alt: Downloads Per Month
.. image::
:alt: Python Versions
.. image::
:alt: The MIT License

Flask application generator for boosting your development.


* **Well Defined Project Structure**

* Use factory pattern to generate Flask app.
* Use Blueprints to organize controllers.
* Split controllers, models, forms, utilities, assets, Jinja2 pages, Jinja2 macros into different directories.
* Organize Jinja2 page assets (HTML, JavaScript, CSS) to the same directory.
* Organize Jinja2 macro assets (HTML, JavaScript, CSS) to the same directory.

* **Batteries Included**

* Use Flask-SQLAlchemy and Flask-Migrate as database tools.
* Use Flask-WTF to validate forms.
* Use Flask-Script to help writing scripts.
* Use Flask-Security for user management.
* Use Flask-OAuthlib for social user authentication.
* Use Bulma as frontend framework.

* Use Gunicorn to run Flask app and Supervisor to manage Gunicorn processes.
* Use Fabric as deployment tool.
* Use Sentry to log exceptions.
* Use Nginx to serve static files.
* Use sub script command to generate admin and form from a model.

* **Scaffold Commands**

* Generate project files: ``turbo new <project>``
* Generate controller files: ``turbo new controller <controller>``
* Generate action files: ``turbo new action <controller> <action> [-t]``
* Generate form files: ``turbo new form <form>``
* Generate model files: ``turbo new model <model>``
* Generate macro files: ``turbo new macro <category> <macro>`` or ``boost new macro <macro>``

.. _permission:



pip install flask-turbo-boost

Development Guide

Init project


turbo new <your_project_name>

Setup backend requirements


cd <your_project_dir>
virtualenv venv
. venv/bin/activate (venv\Scripts\activate in Windows)
pip install -r requirements.txt

**Note**: if you failed in ``pip install -r requirements.txt`` in Windows, try to install package binaries directly:

* pycrpyto: try to follow this article compiling-pycrypto-on-win7-64_, or get the complied pycrypyto library directly: archive_pycrpyto_library_.

.. _compiling-pycrypto-on-win7-64:
.. _archive_pycrpyto_library:

Init database

Create database with name ``your_project_name`` and encoding ``utf8``.

Update ``SQLALCHEMY_DATABASE_URI`` in ``config/`` as needed.

Then init tables::

python db upgrade

Run app

Run local server::

python run

Setup frontend requirements

Install Node.js first and then install Bower_, FIS_ and Gulp_ globally::

npm install -g bower
npm install -g fis
npm install -g fis-postpackager-simple
npm install -g gulp

Install local packages::

npm install
bower install

Run Gulp watch task


gulp watch

LiveReload support

Install LiveReload browser extension from here_.

And use ``python live`` instead of ``python run`` to start app.

.. _here:

Scaffold commands


turbo new <project>
turbo new controller <controller>
turbo new action <controller> <action> [-t]
turbo new form <form>
turbo new model <model>
turbo new macro <category> <macro>
turbo new macro <macro>
turbo -v
turbo -h

First Production Deploy

Config server

Install mysql-server, python-virtualenv, git, supervisor, nginx, g++, python-dev, libmysqlclient-dev, libxml2-dev, libxslt-dev on your server.

Install requirements


git clone **.git
cd <your_project_dir>
virtualenv venv
. venv/bin/activate
pip install -r requirements.txt

Config app

Save ``config/`` as ``config/``, update configs in ``config/`` as needed and transfer it to server.

**Note**: remember to update ``SECRET_KEY`` in ``config/``! You can generate random secret key as follows::

>>> import os
>>> os.urandom(24)

Init database

Create database with name ``your_project_name`` and encoding ``utf8``.

And run::

python db upgrade

Copy config files

Update project root path as needed in ``deploy/nginx.conf`` and ``deploy/supervisor.conf``.


cp deploy/ /etc/profile.d/
cp deploy/nginx.conf /etc/nginx/conf.d/<your_project_name>.conf
cp deploy/supervisor.conf /etc/supervisor/conf.d/<your_project_name>.conf

Start app


service nginx restart
service supervisor restart

Daily Production Deploy

Update ``HOST_STRING`` in config with the format ``user@ip``.

Commit your codes and run::

git push && fab deploy

P.S. If you wanna to deploy flask with Apache2, see this_ post.

.. _this:


File Type Py Version Uploaded on Size
Flask-Turbo-Boost-0.0.11.tar.gz (md5) Source 2017-12-07 608KB