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 提供。