flask black dashboard pro
v1.0.7
管理仪表板由Flask中的 AppSeed 平台在Black Dashboard PRO(现代 Bootstrap 4 仪表板模板)之上生成。 Flask 代码库附带身份验证、数据库、ORM 和部署脚本。
特征
Up-to-date dependencies
SCSS compilation
DBMS
:SQLite、PostgreSQL(生产)DB Tools
:SQLAlchemy ORM、Flask-Migrate(架构迁移)Blueprints
模块化设计从产品页面获取代码
$ unzip flask-dashboard-black-pro.zip
$ cd flask-dashboard-black-pro
在 Docker 中启动应用程序
$ docker-compose up --build
在浏览器中访问http://localhost:5085
。该应用程序应该已启动并正在运行。
$ # Get the code
$ git clone https://github.com/app-generator/priv-flask-dashboard-black-pro.git
$ cd priv-flask-dashboard-black-pro
$
$ # Virtualenv modules installation (Unix based systems)
$ virtualenv env
$ source env/bin/activate
$
$ # Virtualenv modules installation (Windows based systems)
$ # virtualenv env
$ # .envScriptsactivate
$
$ # Install modules - SQLite Database
$ pip3 install -r requirements.txt
$
$ # OR with PostgreSQL connector
$ # pip install -r requirements-pgsql.txt
$
$ # Set the FLASK_APP environment variable
$ (Unix/Mac) export FLASK_APP=run.py
$ (Windows) set FLASK_APP=run.py
$ (Powershell) $env :FLASK_APP = " .run.py "
$
$ # Set up the DEBUG environment
$ # (Unix/Mac) export FLASK_ENV=development
$ # (Windows) set FLASK_ENV=development
$ # (Powershell) $env:FLASK_ENV = "development"
$
$ # Start the application (development mode)
$ # --host=0.0.0.0 - expose the app on all network interfaces (default 127.0.0.1)
$ # --port=5000 - specify the app port (default 5000)
$ flask run --host=0.0.0.0 --port=5000
$
$ # Access the dashboard in browser: http://127.0.0.1:5000/
注意:要使用该应用程序,请访问注册页面并创建新用户。身份验证后,应用程序将解锁私人页面。
该项目使用蓝图、应用程序工厂模式、双配置文件(开发和生产)和如下所示的直观结构进行编码:
< PROJECT ROOT >
|
| -- apps/
| |
| | -- home/ # A simple app that serve HTML files
| | | -- routes.py # Define app routes
| |
| | -- authentication/ # Handles auth routes (login and register)
| | | -- routes.py # Define authentication routes
| | | -- models.py # Defines models
| | | -- forms.py # Define auth forms (login and register)
| |
| | -- static/
| | | -- < css, JS, images > # CSS files, Javascripts files
| |
| | -- templates/ # Templates used to render pages
| | | -- includes/ # HTML chunks and components
| | | | -- navigation.html # Top menu component
| | | | -- sidebar.html # Sidebar component
| | | | -- footer.html # App Footer
| | | | -- scripts.html # Scripts common to all pages
| | |
| | | -- layouts/ # Master pages
| | | | -- base-fullscreen.html # Used by Authentication pages
| | | | -- base.html # Used by common pages
| | |
| | | -- accounts/ # Authentication pages
| | | | -- login.html # Login page
| | | | -- register.html # Register page
| | |
| | | -- home/ # UI Kit Pages
| | | -- index.html # Index page
| | | -- 404-page.html # 404 page
| | | -- * .html # All other pages
| |
| config.py # Set up the app
| __init__.py # Initialize the app
|
| -- requirements.txt # Development modules - SQLite storage
| -- requirements-mysql.txt # Production modules - Mysql DMBS
| -- requirements-pqsql.txt # Production modules - PostgreSql DMBS
|
| -- Dockerfile # Deployment
| -- docker-compose.yml # Deployment
| -- gunicorn-cfg.py # Deployment
| -- nginx # Deployment
| | -- appseed-app.conf # Deployment
|
| -- .env # Inject Configuration via Environment
| -- run.py # Start the app - WSGI gateway
|
| -- ************************************************************************
引导流程
run.py
加载.env
文件create_app
要重新编译 SCSS 文件,请遵循以下设置:
步骤#1 - 安装工具
npm install -g gulp-cli
步骤#2 - 安装模块(这将创建一个经典的
node_modules
目录)
$ npm install
// OR
$ yarn
步骤 #3 - 编辑并重新编译 SCSS 文件
$ gulp
生成的文件保存在apps/static/assets/css
目录中。
Flask Black PRO - 由 AppSeed 提供。