diff --git a/CHANGELOG.md b/CHANGELOG.md index 606789b..648ea47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## [1.0.14] 2023-10-07 +### Changes + +- Update Dependencies +- Silent fallback to SQLite + ## [1.0.13] 2023-06-22 ### Changes diff --git a/Dockerfile b/Dockerfile index 77ce542..9721f32 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9 +FROM python:3.10 # set environment variables ENV PYTHONDONTWRITEBYTECODE 1 diff --git a/README.md b/README.md index 1e06a22..a4e8ba8 100644 --- a/README.md +++ b/README.md @@ -4,28 +4,25 @@ Open-Source **[Flask Dashboard](https://appseed.us/admin-dashboards/flask/)** ge - 👉 [Volt Dashboard Flask](https://appseed.us/product/volt-dashboard/flask/) - `Product page` - 👉 [Volt Dashboard Flask](https://flask-volt-dashboard.appseed-srv1.com/) - `LIVE Demo` -- 👉 [Volt Dashboard Flask](https://docs.appseed.us/products/flask-dashboards/volt/) - `Documentation`
-> 🚀 Built with [App Generator](https://appseed.us/generator), timestamp `2022-06-23 18:20` +## ✅ Features -- ✅ `Up-to-date dependencies` -- ✅ `Database`: `SQLite`, MySql +- `Up-to-date dependencies` +- `Database`: `SQLite`, MySql - Silent fallback to `SQLite` -- ✅ `DB Tools`: SQLAlchemy ORM, `Flask-Migrate` -- ✅ `Authentication`, Session Based, `OAuth` via **Github** -- ✅ Docker, `Flask-Minify` (page compression) -- 🚀 `Deployment` +- `DB Tools`: SQLAlchemy ORM, `Flask-Migrate` +- `Authentication`, Session Based, `OAuth` via **Github** +- Docker, `Flask-Minify` (page compression) +- `Deployment` - `CI/CD` flow via `Render` -
- ![Volt Dashboard - Full-Stack Starter generated by AppSeed.](https://user-images.githubusercontent.com/51070104/168843604-b026fd94-5969-4be7-81ac-5887cf0958e5.png)
-## ✨ Quick start in `Docker` +## ✅ Start in `Docker` > 👉 **Step 1** - Download the code from the GH repository (using `GIT`) @@ -44,15 +41,8 @@ $ docker-compose up --build Visit `http://localhost:5085` in your browser. The app should be up & running. -
-## ✨ Video Presentation - -https://user-images.githubusercontent.com/51070104/195502745-2cfb4eff-7434-424f-ab6a-c0d91ea5e480.mp4 - -
- -### ✨ Create a new `.env` file using sample `env.sample` +## ✅ Create `.env` file The meaning of each variable can be found below: @@ -64,9 +54,8 @@ The meaning of each variable can be found below: - `GITHUB_ID`= - `GITHUB_SECRET`= -
-## ✨ Manual Build +## ✅ Manual Build > Download the code @@ -160,7 +149,7 @@ By default, the app redirects guest users to authenticate. In order to access th
-## ✨ Code-base structure +## ✅ Codebase The project is coded using blueprints, app factory pattern, dual configuration profile (development and production) and an intuitive structure presented bellow: @@ -213,7 +202,7 @@ The project is coded using blueprints, app factory pattern, dual configuration p
-## [PRO Version](https://appseed.us/product/volt-dashboard-pro/flask/) +## ✅ [PRO Version](https://appseed.us/product/volt-dashboard-pro/flask/) > For more components, pages and priority on support, feel free to take a look at this amazing starter: @@ -223,8 +212,6 @@ Volt Pro is a premium Bootstrap 5 Admin Dashboard featuring over 800 components, - ✅ `Enhanced UI` - more pages and components - ✅ `Priority` on support -
- ![Volt Dashboard PRO - Starter generated by AppSeed.](https://user-images.githubusercontent.com/51070104/172672843-8c40a801-3438-4e9c-86db-38a34191fbdf.png)
diff --git a/apps/__init__.py b/apps/__init__.py index dcbb60d..0b682bc 100644 --- a/apps/__init__.py +++ b/apps/__init__.py @@ -3,8 +3,6 @@ Copyright (c) 2019 - present AppSeed.us """ -import os - from flask import Flask from flask_login import LoginManager from flask_sqlalchemy import SQLAlchemy @@ -53,9 +51,9 @@ def create_app(config): app = Flask(__name__) app.config.from_object(config) register_extensions(app) - register_blueprints(app) - app.register_blueprint(github_blueprint, url_prefix="/login") + app.register_blueprint(github_blueprint, url_prefix="/login") + register_blueprints(app) configure_database(app) return app diff --git a/apps/authentication/oauth.py b/apps/authentication/oauth.py index fa33165..8577d1f 100644 --- a/apps/authentication/oauth.py +++ b/apps/authentication/oauth.py @@ -9,7 +9,6 @@ from flask_dance.consumer import oauth_authorized from flask_dance.contrib.github import github, make_github_blueprint from flask_dance.consumer.storage.sqla import SQLAlchemyStorage -from flask_dance.contrib.twitter import twitter, make_twitter_blueprint from sqlalchemy.orm.exc import NoResultFound from apps.config import Config from .models import Users, db, OAuth diff --git a/apps/config.py b/apps/config.py index 0756965..9b54e6a 100644 --- a/apps/config.py +++ b/apps/config.py @@ -9,23 +9,10 @@ class Config(object): basedir = os.path.abspath(os.path.dirname(__file__)) - # Assets Management - ASSETS_ROOT = os.getenv('ASSETS_ROOT', '/static/assets') - # Set up the App SECRET_KEY SECRET_KEY = os.getenv('SECRET_KEY', None) if not SECRET_KEY: - SECRET_KEY = ''.join(random.choice( string.ascii_lowercase ) for i in range( 32 )) - - # Social AUTH context - SOCIAL_AUTH_GITHUB = False - - GITHUB_ID = os.getenv('GITHUB_ID' , None) - GITHUB_SECRET = os.getenv('GITHUB_SECRET', None) - - # Enable/Disable Github Social Login - if GITHUB_ID and GITHUB_SECRET: - SOCIAL_AUTH_GITHUB = True + SECRET_KEY = ''.join(random.choice( string.ascii_lowercase ) for i in range( 32 )) SQLALCHEMY_TRACK_MODIFICATIONS = False @@ -63,8 +50,20 @@ class Config(object): if USE_SQLITE: # This will create a file in FOLDER - SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'db.sqlite3') + SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'db.sqlite3') + + # Assets Management + ASSETS_ROOT = os.getenv('ASSETS_ROOT', '/static/assets') + SOCIAL_AUTH_GITHUB = False + + GITHUB_ID = os.getenv('GITHUB_ID') + GITHUB_SECRET = os.getenv('GITHUB_SECRET') + + # Enable/Disable Github Social Login + if GITHUB_ID and GITHUB_SECRET: + SOCIAL_AUTH_GITHUB = True + class ProductionConfig(Config): DEBUG = False @@ -73,9 +72,11 @@ class ProductionConfig(Config): REMEMBER_COOKIE_HTTPONLY = True REMEMBER_COOKIE_DURATION = 3600 + class DebugConfig(Config): DEBUG = True + # Load all possible configurations config_dict = { 'Production': ProductionConfig, diff --git a/package.json b/package.json index eac2b45..a17c007 100644 --- a/package.json +++ b/package.json @@ -1,4 +1,4 @@ -{ + "name": "boilerplate-code-flask-dashboard", "mastertemplate": "boilerplate-code-flask-dashboard", "version": "2stable.0.1", diff --git a/requirements.txt b/requirements.txt index 20c435d..0cdd57c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,20 +1,22 @@ -flask==2.0.2 -flask_login==0.5.0 -flask_migrate==3.1.0 +flask==2.2.5 +Werkzeug==2.3.7 +jinja2==3.1.2 +flask-login==0.6.2 +flask_migrate==4.0.4 WTForms==3.0.1 -flask_wtf==1.0.0 -flask_sqlalchemy==2.5.1 -sqlalchemy==1.4.29 -email_validator==1.1.3 -gunicorn==20.1.0 -jinja2==3.0.3 -flask-restx==0.5.1 -Werkzeug==2.0.3 +flask_wtf==1.2.1 +flask-sqlalchemy==3.0.5 +sqlalchemy==2.0.21 +email_validator==2.0.0 +flask-restx==1.1.0 + python-dotenv==0.19.2 + +gunicorn==20.1.0 Flask-Minify==0.37 -Flask-Dance==5.1.0 -blinker==1.4 -pyOpenSSL + +flask-dance==7.0.0 +blinker==1.6.2 # flask_mysqldb # psycopg2-binary diff --git a/run.py b/run.py index 55c2e29..55aa4a2 100644 --- a/run.py +++ b/run.py @@ -30,7 +30,7 @@ if not DEBUG: Minify(app=app, html=True, js=False, cssless=False) - + if DEBUG: app.logger.info('DEBUG = ' + str(DEBUG) ) app.logger.info('Page Compression = ' + 'FALSE' if DEBUG else 'TRUE' )