├── .dockerignore ├── .env ├── .gitignore ├── CHANGELOG.md ├── Dockerfile ├── LICENSE.md ├── README.md ├── apps ├── __init__.py ├── authentication │ ├── __init__.py │ ├── forms.py │ ├── models.py │ ├── oauth.py │ ├── routes.py │ └── util.py ├── charts │ ├── __init__.py │ └── routes.py ├── config.py ├── dyn_dt │ ├── __init__.py │ ├── routes.py │ └── utils.py ├── exceptions │ └── exception.py ├── helpers.py ├── home │ ├── __init__.py │ └── routes.py └── models.py ├── build.sh ├── docker-compose.yml ├── env.sample ├── gunicorn-cfg.py ├── media ├── flask-boilerplate-dashboard-argon-card-low.jpg ├── flask-boilerplate-dashboard-argon-card-low.png ├── flask-boilerplate-dashboard-argon-card.jpg ├── flask-boilerplate-dashboard-argon-card.png ├── flask-boilerplate-dashboard-argon-content-image-low.png ├── flask-boilerplate-dashboard-argon-content-image.png ├── flask-boilerplate-dashboard-argon-intro.gif ├── flask-boilerplate-dashboard-argon-screen-1-low.png ├── flask-boilerplate-dashboard-argon-screen-1.png ├── flask-boilerplate-dashboard-argon-screen-2-low.png ├── flask-boilerplate-dashboard-argon-screen-2.png ├── flask-boilerplate-dashboard-argon-screen-3-low.png ├── flask-boilerplate-dashboard-argon-screen-3.png ├── flask-boilerplate-dashboard-argon-screen-4-low.png ├── flask-boilerplate-dashboard-argon-screen-4.png ├── flask-boilerplate-dashboard-argon-screen-login-low.png ├── flask-boilerplate-dashboard-argon-screen-login.png ├── flask-boilerplate-dashboard-argon-screen-low.png ├── flask-boilerplate-dashboard-argon-screen-register-low.png ├── flask-boilerplate-dashboard-argon-screen-register.png └── flask-boilerplate-dashboard-argon-screen.png ├── nginx └── appseed-app.conf ├── package.json ├── postcss.config.js ├── render.yaml ├── requirements.txt ├── run.py ├── static └── assets │ ├── .gitkeep │ ├── css │ ├── argon-dashboard.css │ ├── argon-dashboard.css.map │ ├── argon-dashboard.min.css │ ├── nucleo-icons.css │ └── nucleo-svg.css │ ├── fonts │ ├── nucleo-icons.eot │ ├── nucleo-icons.svg │ ├── nucleo-icons.ttf │ ├── nucleo-icons.woff │ ├── nucleo-icons.woff2 │ ├── nucleo.eot │ ├── nucleo.ttf │ ├── nucleo.woff │ └── nucleo.woff2 │ ├── gulpfile.js │ ├── img │ ├── apple-icon.png │ ├── bg-profile.jpg │ ├── bg1.jpg │ ├── bruce-mars.jpg │ ├── carousel-1.jpg │ ├── carousel-2.jpg │ ├── carousel-3.jpg │ ├── csv.png │ ├── curved-images │ │ ├── curved-10.jpg │ │ ├── curved-11.jpg │ │ ├── curved-6.jpg │ │ ├── curved-8.jpg │ │ ├── curved0.jpg │ │ ├── curved1.jpg │ │ ├── curved10.jpg │ │ ├── curved11-small.jpg │ │ ├── curved11.jpg │ │ ├── curved12.jpg │ │ ├── curved13.jpg │ │ ├── curved14.jpg │ │ ├── curved19.jpg │ │ ├── curved2.jpg │ │ ├── curved21.jpg │ │ ├── curved3.jpg │ │ ├── curved4.jpg │ │ ├── curved5-small.jpg │ │ ├── curved5.jpg │ │ ├── curved6-small.jpg │ │ ├── curved6.jpg │ │ ├── curved7.jpg │ │ ├── curved8.jpg │ │ ├── curved9.jpg │ │ └── white-curved.jpeg │ ├── down-arrow-dark.svg │ ├── down-arrow-white.svg │ ├── down-arrow.svg │ ├── export.png │ ├── favicon.png │ ├── home-decor-1.jpg │ ├── home-decor-2.jpg │ ├── home-decor-3.jpg │ ├── icons │ │ └── flags │ │ │ ├── AU.png │ │ │ ├── BR.png │ │ │ ├── DE.png │ │ │ ├── GB.png │ │ │ └── US.png │ ├── illustrations │ │ ├── icon-documentation.svg │ │ └── rocket-white.png │ ├── ivana-square.jpg │ ├── ivancik.jpg │ ├── kal-visuals-square.jpg │ ├── logo-ct-dark.png │ ├── logo-ct.png │ ├── logos │ │ ├── mastercard.png │ │ └── visa.png │ ├── marie.jpg │ ├── profile-layout-header.jpg │ ├── shapes │ │ ├── pattern-lines.svg │ │ ├── shape-1.svg │ │ ├── shape-2.svg │ │ ├── shape-3.svg │ │ ├── wave-down.svg │ │ ├── wave-up.svg │ │ ├── waves-gray.svg │ │ └── waves-white.svg │ ├── small-logos │ │ ├── icon-sun-cloud.png │ │ ├── logo-atlassian.svg │ │ ├── logo-invision.svg │ │ ├── logo-jira.svg │ │ ├── logo-slack.svg │ │ ├── logo-spotify.svg │ │ ├── logo-webdev.svg │ │ └── logo-xd.svg │ ├── team-1.jpg │ ├── team-2.jpg │ ├── team-3.jpg │ ├── team-4.jpg │ ├── theme │ │ ├── angular.jpg │ │ ├── bootstrap.jpg │ │ ├── dribbble.png │ │ ├── dropbox.png │ │ ├── mastercard.png │ │ ├── paypal.png │ │ ├── react.jpg │ │ ├── sketch.jpg │ │ ├── slack.png │ │ ├── spotify.jpeg │ │ ├── tim.png │ │ ├── unass.jpg │ │ ├── visa.png │ │ └── vue.jpg │ └── vr-bg.jpg │ ├── js │ ├── argon-dashboard.js │ ├── argon-dashboard.js.map │ ├── argon-dashboard.min.js │ ├── core │ │ ├── bootstrap.bundle.min.js │ │ ├── bootstrap.min.js │ │ └── popper.min.js │ └── plugins │ │ ├── Chart.extension.js │ │ ├── bootstrap-notify.js │ │ ├── chartjs.min.js │ │ ├── perfect-scrollbar.min.js │ │ └── smooth-scrollbar.min.js │ ├── package.json │ └── scss │ ├── argon-dashboard.scss │ └── argon-dashboard │ ├── _alert.scss │ ├── _avatars.scss │ ├── _badge.scss │ ├── _breadcrumbs.scss │ ├── _buttons.scss │ ├── _cards.scss │ ├── _dark-version.scss │ ├── _dropdown.scss │ ├── _dropup.scss │ ├── _fixed-plugin.scss │ ├── _footer.scss │ ├── _forms.scss │ ├── _gradients.scss │ ├── _header.scss │ ├── _info-areas.scss │ ├── _misc.scss │ ├── _nav.scss │ ├── _navbar-vertical.scss │ ├── _navbar.scss │ ├── _pagination.scss │ ├── _popovers.scss │ ├── _progress.scss │ ├── _rtl.scss │ ├── _social-buttons.scss │ ├── _tables.scss │ ├── _tilt.scss │ ├── _timeline.scss │ ├── _tooltips.scss │ ├── _typography.scss │ ├── _utilities-extend.scss │ ├── _utilities.scss │ ├── _variables.scss │ ├── bootstrap │ ├── _accordion.scss │ ├── _alert.scss │ ├── _badge.scss │ ├── _breadcrumb.scss │ ├── _button-group.scss │ ├── _buttons.scss │ ├── _card.scss │ ├── _carousel.scss │ ├── _close.scss │ ├── _containers.scss │ ├── _dropdown.scss │ ├── _forms.scss │ ├── _functions.scss │ ├── _grid.scss │ ├── _helpers.scss │ ├── _images.scss │ ├── _list-group.scss │ ├── _maps.scss │ ├── _mixins.scss │ ├── _modal.scss │ ├── _nav.scss │ ├── _navbar.scss │ ├── _offcanvas.scss │ ├── _pagination.scss │ ├── _placeholders.scss │ ├── _popover.scss │ ├── _progress.scss │ ├── _reboot.scss │ ├── _root.scss │ ├── _spinners.scss │ ├── _tables.scss │ ├── _toasts.scss │ ├── _tooltip.scss │ ├── _transitions.scss │ ├── _type.scss │ ├── _utilities.scss │ ├── _variables.scss │ ├── bootstrap-grid.scss │ ├── bootstrap-reboot.scss │ ├── bootstrap-utilities.scss │ ├── bootstrap.scss │ ├── forms │ │ ├── _floating-labels.scss │ │ ├── _form-check.scss │ │ ├── _form-control.scss │ │ ├── _form-range.scss │ │ ├── _form-select.scss │ │ ├── _form-text.scss │ │ ├── _input-group.scss │ │ ├── _labels.scss │ │ └── _validation.scss │ ├── helpers │ │ ├── _clearfix.scss │ │ ├── _color-bg.scss │ │ ├── _colored-links.scss │ │ ├── _position.scss │ │ ├── _ratio.scss │ │ ├── _stacks.scss │ │ ├── _stretched-link.scss │ │ ├── _text-truncation.scss │ │ ├── _visually-hidden.scss │ │ └── _vr.scss │ ├── mixins │ │ ├── _alert.scss │ │ ├── _backdrop.scss │ │ ├── _border-radius.scss │ │ ├── _box-shadow.scss │ │ ├── _breakpoints.scss │ │ ├── _buttons.scss │ │ ├── _caret.scss │ │ ├── _clearfix.scss │ │ ├── _color-scheme.scss │ │ ├── _container.scss │ │ ├── _deprecate.scss │ │ ├── _forms.scss │ │ ├── _gradients.scss │ │ ├── _grid.scss │ │ ├── _image.scss │ │ ├── _list-group.scss │ │ ├── _lists.scss │ │ ├── _pagination.scss │ │ ├── _reset-text.scss │ │ ├── _resize.scss │ │ ├── _table-variants.scss │ │ ├── _text-truncate.scss │ │ ├── _transition.scss │ │ ├── _utilities.scss │ │ └── _visually-hidden.scss │ ├── utilities │ │ └── _api.scss │ └── vendor │ │ └── _rfs.scss │ ├── cards │ ├── card-background.scss │ └── card-carousel.scss │ ├── custom │ ├── _styles.scss │ └── _variables.scss │ ├── forms │ ├── _form-check.scss │ ├── _form-select.scss │ ├── _form-switch.scss │ ├── _forms.scss │ ├── _input-group.scss │ ├── _inputs.scss │ └── _labels.scss │ ├── mixins │ ├── _badge.scss │ ├── _colored-shadows.scss │ ├── _hover.scss │ ├── _social-buttons.scss │ └── mixins.scss │ ├── plugins │ └── free │ │ ├── _flatpickr.scss │ │ ├── _nouislider.scss │ │ ├── _perfect-scrollbar.scss │ │ ├── _prism.scss │ │ └── plugins.scss │ ├── theme.scss │ └── variables │ ├── _animations.scss │ ├── _avatars.scss │ ├── _badge.scss │ ├── _breadcrumb.scss │ ├── _cards-extend.scss │ ├── _cards.scss │ ├── _choices.scss │ ├── _dark-version.scss │ ├── _dropdowns.scss │ ├── _fixed-plugin.scss │ ├── _form-switch.scss │ ├── _full-calendar.scss │ ├── _header.scss │ ├── _info-areas.scss │ ├── _misc-extend.scss │ ├── _misc.scss │ ├── _navbar-vertical.scss │ ├── _navbar.scss │ ├── _pagination.scss │ ├── _rtl.scss │ ├── _social-buttons.scss │ ├── _table.scss │ ├── _timeline.scss │ ├── _utilities-extend.scss │ ├── _utilities.scss │ └── _virtual-reality.scss ├── templates ├── .gitkeep ├── accounts │ ├── login.html │ └── register.html ├── charts │ └── index.html ├── dyn_dt │ ├── index.html │ └── model.html ├── home │ ├── billing.html │ ├── index.html │ ├── page-403.html │ ├── page-404.html │ ├── page-500.html │ ├── profile.html │ ├── rtl.html │ ├── sign-in.html │ ├── sign-up.html │ ├── tables.html │ └── virtual-reality.html ├── includes │ ├── fixed-plugin.html │ ├── footer.html │ ├── items-table.html │ ├── navigation-auth.html │ ├── navigation-rtl.html │ ├── navigation-vr.html │ ├── navigation.html │ ├── scripts.html │ ├── sidenav-rtl.html │ └── sidenav.html └── layouts │ ├── base-fullscreen.html │ ├── base-rtl.html │ └── base.html └── vite.config.js /.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | __pycache__ 3 | *.pyc 4 | *.pyo 5 | *.pyd -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | # True for development, False for production 2 | DEBUG=True 3 | 4 | # Flask ENV 5 | FLASK_APP=run.py 6 | FLASK_DEBUG=1 7 | 8 | # If not provided, a random one is generated 9 | # SECRET_KEY= 10 | 11 | # If DEBUG=False (production mode) 12 | # DB_ENGINE=mysql 13 | # DB_NAME=appseed_db 14 | # DB_HOST=localhost 15 | # DB_PORT=3306 16 | # DB_USERNAME=appseed_db_usr 17 | # DB_PASS= 18 | 19 | # SOCIAL AUTH Github 20 | # GITHUB_ID=YOUR_GITHUB_ID 21 | # GITHUB_SECRET=YOUR_GITHUB_SECRET 22 | 23 | # SOCIAL AUTH Google 24 | # GOOGLE_ID=YOUR_GOOGLE_ID 25 | # GOOGLE_SECRET=YOUR_GOOGLE_SECRET 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # tests and coverage 6 | *.pytest_cache 7 | .coverage 8 | 9 | # database & logs 10 | *.db 11 | *.sqlite3 12 | *.log 13 | 14 | # venv 15 | env 16 | venv 17 | 18 | # other 19 | .DS_Store 20 | 21 | # sphinx docs 22 | _build 23 | _static 24 | _templates 25 | 26 | # javascript 27 | package-lock.json 28 | .vscode/symbols.json 29 | 30 | apps/static/assets/node_modules 31 | apps/static/assets/yarn.lock 32 | apps/static/assets/.temp 33 | 34 | README_bk.md 35 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.10 2 | 3 | # set environment variables 4 | ENV PYTHONDONTWRITEBYTECODE 1 5 | ENV PYTHONUNBUFFERED 1 6 | 7 | COPY requirements.txt . 8 | 9 | # install python dependencies 10 | RUN pip install --upgrade pip 11 | RUN pip install --no-cache-dir -r requirements.txt 12 | 13 | COPY . . 14 | 15 | # gunicorn 16 | CMD ["gunicorn", "--config", "gunicorn-cfg.py", "run:app"] 17 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (c) 2019 - present [AppSeed](http://appseed.us/) 4 | 5 |
6 | 7 | ## Licensing Information 8 | 9 |
10 | 11 | | Item | - | 12 | | ---------------------------------- | --- | 13 | | License Type | MIT | 14 | | Use for print | **YES** | 15 | | Create single personal website/app | **YES** | 16 | | Create single website/app for client | **YES** | 17 | | Create multiple website/apps for clients | **YES** | 18 | | Create multiple SaaS applications | **YES** | 19 | | End-product paying users | **YES** | 20 | | Product sale | **YES** | 21 | | Remove footer credits | **YES** | 22 | | --- | --- | 23 | | Remove copyright mentions from source code | NO | 24 | | Production deployment assistance | NO | 25 | | Create HTML/CSS template for sale | NO | 26 | | Create Theme/Template for CMS for sale | NO | 27 | | Separate sale of our UI Elements | NO | 28 | 29 |
30 | 31 | --- 32 | For more information regarding licensing, please contact the AppSeed Service < *support@appseed.us* > 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [Flask Argon Dashboard](https://app-generator.dev/product/argon-dashboard/flask/) 2 | 3 | Open-source **Flask Starter with Argon Dashboard Design**, an open-source iconic `Bootstrap` design. 4 | The product is designed to deliver the best possible user experience with highly customizable feature-rich pages. 5 | 6 | - 👉 [Flask Argon Dashboard](https://app-generator.dev/product/argon-dashboard/flask/) - `Product Page` 7 | - 👉 [Flask Argon Dashboard](https://flask-argon.onrender.com/) - `LIVE Demo` 8 | - 👉 [Flask Argon Dashboard](https://app-generator.dev/docs/products/flask/argon-dashboard/index.html) - `Complete Information` and Support Links 9 | - [Getting Started with Flask](https://app-generator.dev/docs/technologies/flask/index.html) - a `comprehensive tutorial` 10 | - `Configuration`: Install Tailwind/Flowbite, Prepare Environment, Setting up the Database 11 | - `Start with Docker` 12 | - `Manual Build` 13 | - `Start the project` 14 | - `Deploy on Render` 15 | 16 |
17 | 18 | ### Customize with [Flask App Generator](https://app-generator.dev/tools/flask-generator/) 19 | 20 | - Access the [App Generator](https://app-generator.dev/tools/flask-generator/) page 21 | - Select the preferred design 22 | - (Optional) Design Database: edit models and fields 23 | - (Optional) Edit the fields for the extended user model 24 | - (Optional) Enable OAuth for GitHub 25 | - (Optional) Add Celery (async tasks) 26 | - (Optional) Enable Dynamic Tables Module 27 | - Docker Scripts 28 | - Render CI/Cd Scripts 29 | 30 | **The generated Flask project is available as a ZIP Archive and also uploaded to GitHub.** 31 | 32 |
33 | 34 | ## Deploy on `Render` (free plan) 35 | 36 | [![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy) 37 | 38 |
39 | 40 | ## Features 41 | 42 | - Simple, Easy-to-Extend codebase, [Blueprint Pattern](https://app-generator.dev/blog/flask-blueprints-a-developers-guide/) 43 | - Up-to-date Dependencies 44 | - [Argon Dashboard](https://app-generator.dev/docs/templates/bootstrap/argon-dashboard.html) Full Integration 45 | - [Bootstrap](https://app-generator.dev/docs/templates/bootstrap/index.html) 5 Styling 46 | - Auth: Session Based, GitHub, Google 47 | - Celery Beat 48 | - DB Persistence: SQLite (default), 49 | - Easy switch to MySql/MariaDB, PgSql 50 | - Dynamic DataTables - manage data without coding 51 | - CI/CD integration for [Render](https://app-generator.dev/docs/deployment/render/index.html) 52 | - Deployment: Docker, Flask-Minify 53 | 54 | ![Argon Dashboard - Starter generated by AppSeed.](https://user-images.githubusercontent.com/51070104/183684596-4b29a886-f13d-4da5-98d3-12b5b90df47f.png) 55 | 56 |
57 | 58 | --- 59 | [Flask Argon Dashboard](https://app-generator.dev/product/argon-dashboard/flask/) - Open-Source **Flask** Starter provided by [App Generator](https://app-generator.dev) 60 | -------------------------------------------------------------------------------- /apps/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- encoding: utf-8 -*- 2 | """ 3 | Copyright (c) 2019 - present AppSeed.us 4 | """ 5 | 6 | import os 7 | from flask import Flask 8 | from flask_login import LoginManager 9 | from flask_sqlalchemy import SQLAlchemy 10 | from importlib import import_module 11 | 12 | db = SQLAlchemy() 13 | login_manager = LoginManager() 14 | 15 | def register_extensions(app): 16 | db.init_app(app) 17 | login_manager.init_app(app) 18 | 19 | def register_blueprints(app): 20 | for module_name in ('authentication', 'home', 'dyn_dt', 'charts', ): 21 | module = import_module('apps.{}.routes'.format(module_name)) 22 | app.register_blueprint(module.blueprint) 23 | 24 | from apps.authentication.oauth import github_blueprint, google_blueprint 25 | 26 | def create_app(config): 27 | 28 | # Contextual 29 | static_prefix = '/static' 30 | templates_dir = os.path.dirname(config.BASE_DIR) 31 | 32 | TEMPLATES_FOLDER = os.path.join(templates_dir,'templates') 33 | STATIC_FOLDER = os.path.join(templates_dir,'static') 34 | 35 | print(' > TEMPLATES_FOLDER: ' + TEMPLATES_FOLDER) 36 | print(' > STATIC_FOLDER: ' + STATIC_FOLDER) 37 | 38 | app = Flask(__name__, static_url_path=static_prefix, template_folder=TEMPLATES_FOLDER, static_folder=STATIC_FOLDER) 39 | 40 | app.config.from_object(config) 41 | register_extensions(app) 42 | register_blueprints(app) 43 | app.register_blueprint(github_blueprint, url_prefix="/login") 44 | app.register_blueprint(google_blueprint, url_prefix="/login") 45 | return app 46 | -------------------------------------------------------------------------------- /apps/authentication/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- encoding: utf-8 -*- 2 | """ 3 | Copyright (c) 2019 - present AppSeed.us 4 | """ 5 | 6 | from flask import Blueprint 7 | 8 | blueprint = Blueprint( 9 | 'authentication_blueprint', 10 | __name__, 11 | url_prefix='' 12 | ) 13 | -------------------------------------------------------------------------------- /apps/authentication/forms.py: -------------------------------------------------------------------------------- 1 | # -*- encoding: utf-8 -*- 2 | """ 3 | Copyright (c) 2019 - present AppSeed.us 4 | """ 5 | 6 | from flask_wtf import FlaskForm 7 | from wtforms import StringField, PasswordField 8 | from wtforms.validators import Email, DataRequired 9 | 10 | # login and registration 11 | 12 | 13 | class LoginForm(FlaskForm): 14 | username = StringField('Username', 15 | id='username_login', 16 | validators=[DataRequired()]) 17 | password = PasswordField('Password', 18 | id='pwd_login', 19 | validators=[DataRequired()]) 20 | 21 | 22 | class CreateAccountForm(FlaskForm): 23 | username = StringField('Username', 24 | id='username_create', 25 | validators=[DataRequired()]) 26 | email = StringField('Email', 27 | id='email_create', 28 | validators=[DataRequired(), Email()]) 29 | password = PasswordField('Password', 30 | id='pwd_create', 31 | validators=[DataRequired()]) 32 | -------------------------------------------------------------------------------- /apps/authentication/util.py: -------------------------------------------------------------------------------- 1 | # -*- encoding: utf-8 -*- 2 | """ 3 | Copyright (c) 2019 - present AppSeed.us 4 | """ 5 | 6 | import os 7 | import hashlib 8 | import binascii 9 | 10 | # Inspiration -> https://www.vitoshacademy.com/hashing-passwords-in-python/ 11 | 12 | 13 | def hash_pass(password): 14 | """Hash a password for storing.""" 15 | 16 | salt = hashlib.sha256(os.urandom(60)).hexdigest().encode('ascii') 17 | pwdhash = hashlib.pbkdf2_hmac('sha512', password.encode('utf-8'), 18 | salt, 100000) 19 | pwdhash = binascii.hexlify(pwdhash) 20 | return (salt + pwdhash) # return bytes 21 | 22 | 23 | def verify_pass(provided_password, stored_password): 24 | """Verify a stored password against one provided by user""" 25 | 26 | stored_password = stored_password.decode('ascii') 27 | salt = stored_password[:64] 28 | stored_password = stored_password[64:] 29 | pwdhash = hashlib.pbkdf2_hmac('sha512', 30 | provided_password.encode('utf-8'), 31 | salt.encode('ascii'), 32 | 100000) 33 | pwdhash = binascii.hexlify(pwdhash).decode('ascii') 34 | return pwdhash == stored_password 35 | -------------------------------------------------------------------------------- /apps/charts/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- encoding: utf-8 -*- 2 | """ 3 | Copyright (c) 2019 - present AppSeed.us 4 | """ 5 | 6 | from flask import Blueprint 7 | 8 | blueprint = Blueprint( 9 | 'charts_blueprint', 10 | __name__, 11 | url_prefix='' 12 | ) 13 | -------------------------------------------------------------------------------- /apps/charts/routes.py: -------------------------------------------------------------------------------- 1 | # -*- encoding: utf-8 -*- 2 | """ 3 | Copyright (c) 2019 - present AppSeed.us 4 | """ 5 | 6 | from apps.charts import blueprint 7 | from flask import render_template 8 | from apps.models import Product 9 | 10 | @blueprint.route('/charts') 11 | def charts(): 12 | products = [{'name': product.name, 'price': product.price} for product in Product.get_list()] 13 | return render_template('charts/index.html', segment='charts', products=products) -------------------------------------------------------------------------------- /apps/dyn_dt/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- encoding: utf-8 -*- 2 | """ 3 | Copyright (c) 2019 - present AppSeed.us 4 | """ 5 | 6 | from flask import Blueprint 7 | 8 | blueprint = Blueprint( 9 | 'table_blueprint', 10 | __name__, 11 | url_prefix='' 12 | ) 13 | -------------------------------------------------------------------------------- /apps/exceptions/exception.py: -------------------------------------------------------------------------------- 1 | # -*- encoding: utf-8 -*- 2 | """ 3 | Copyright (c) 2019 - present AppSeed.us 4 | """ 5 | 6 | class InvalidUsage(Exception): 7 | status_code = 400 8 | 9 | def __init__(self, message, status_code=None, payload=None): 10 | Exception.__init__(self) 11 | self.message = message 12 | if status_code is not None: 13 | self.status_code = status_code 14 | self.payload = payload 15 | 16 | def to_dict(self): 17 | rv = dict(self.payload or ()) 18 | rv['message'] = self.message 19 | 20 | return rv -------------------------------------------------------------------------------- /apps/home/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- encoding: utf-8 -*- 2 | """ 3 | Copyright (c) 2019 - present AppSeed.us 4 | """ 5 | 6 | from flask import Blueprint 7 | 8 | blueprint = Blueprint( 9 | 'home_blueprint', 10 | __name__, 11 | url_prefix='' 12 | ) 13 | -------------------------------------------------------------------------------- /apps/home/routes.py: -------------------------------------------------------------------------------- 1 | # -*- encoding: utf-8 -*- 2 | """ 3 | Copyright (c) 2019 - present AppSeed.us 4 | """ 5 | 6 | from apps.home import blueprint 7 | from flask import render_template, request 8 | from flask_login import login_required 9 | from jinja2 import TemplateNotFound 10 | 11 | 12 | @blueprint.route('/index') 13 | @login_required 14 | def index(): 15 | 16 | return render_template('home/index.html', segment='index') 17 | 18 | 19 | @blueprint.route('/