Flask Appbuilder Installation

Source: Internet
Author: User
Tags virtual environment virtualenv

installation

The installation is simple and is installed using a common Python package. I recommend that you install the base skeleton application separately so that you can run the application immediately (no model number) and a template that is easy to grow.

Simple installation

You can install the framework in the following ways:

$ pip Install Flask-appbuilder

Recommended Virtual Environment Installation

virtual environments are very desirable because the more projects you have, the more likely you will be to use different versions of Python itself, or at least a different version of the Python library. Let's face it: libraries are often compatible, and no serious application can have 0 dependencies. So what do you do if two or more projects have conflicting dependencies?

If you are on Mac OS X or Linux, one of the following two commands may apply to you:

$ sudo easy_install virtualenv

Even better:

$ sudo pip install virtualenv

One of them may install virtualenv on your system. Maybe this is your package manager. If you are using a Debian system (such as Ubuntu), please try:

$ sudo apt-get install python-virtualenv

Next, create a virtualenv:

$ virtualenv venvnew python executable in venv/bin/pythoninstalling distribute............done.$. Venv/bin/activate (venv) $

Now installing fab in a virtual environment, it installs all dependencies, which are isolated from the system's Python package

(venv) $ pip Install Flask-appbuilder

Once you have installed the virtualenv, please use Fabmanager command-line tool to create your first application. So create a skeleton application and the first Admin user:

(venv) $ fabmanager create-appyour new app Name:first_appyour engine type, SQLAlchemy or Mongoengine [SQLAlchemy]:D ownload Ed The Skeleton app, good coding! (VENV) $ cd First_app (venv) $ fabmanager create-adminusername [admin]:user First name [Admin]:user last Name [User]:email] [[ Email protected]]:P assword:repeat for confirmation:

The framework immediately inserts all possible permissions in the database that will be associated with the you just created of the Administrator User of the Admin The role is associated . you are ready to run:

(venv) $ fabmanager Run

This will start a Web development server

you now have a running Development server on http://localhost:8080 .

in fact, you don't need to run Appbuilder's framework application, but this is a good start. This first application is based on the SQLAlchemy.

Attention
There are two types of skeletons available, which you can select from the SQLAlchemy default or Mongongine for MongoDB. To use the mongoengine skeleton, you need to install the flask-mongoengine extension.
Initialize
Since the 1.3.0 version, no administrator user has been created automatically, you must use Fabmanager to do this. There are many other useful options that can be used with fabmanager, such as resetting a user's password, listing all users and views, and so on.
Installation Requirements

Flask App Builder relies on

  • Flask:web framework, which is what we are expanding.
  • Flask-sqlalchemy:db access (see SQLAlchemy).
  • Flask-login: Login, flask on the session.
  • Flask-openid: Turn on ID authentication.
  • Flask-wtform:web the form.
  • Flask-babel: for internationalization.

If you plan to use image processing or uploading, you will need to install PIL:

Pip install pillowor:p IP Install PIL
Python 2 and 3 compatibility

The framework itself is compatible and has been tested for Python 2.6,2.7 and 3.3. However, there is still a problem in Python 3.3, the framework internationalization feature uses excellent package Babel, but I find Python 3.3 incompatible. Although this problem is not resolved, there is a limitation on the Py3.3 on fab, you cannot use the Babel function, so you can only set the English in the configuration:

Babel_default_locale = ' en 'babel_default_folder = ' translations 'LANGUAGES = {    ' en ': {' flag ': ' GB ', ' Name ': ' 中文版 '}}   

Flask Appbuilder Installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.