Full Readme, .env_debug
This commit is contained in:
parent
abf60b3ac4
commit
dcced28f84
5 changed files with 88 additions and 2 deletions
|
@ -11,11 +11,13 @@ from dotenv import load_dotenv
|
|||
from flask import Flask
|
||||
|
||||
from . import exts
|
||||
from . import db
|
||||
|
||||
# Add your routes here
|
||||
from .routes import Routes
|
||||
from . import pages
|
||||
from . import admin
|
||||
from . import errors
|
||||
from . import db
|
||||
|
||||
routes: List[Type[Routes]] = [
|
||||
pages.RoutePages,
|
||||
|
@ -37,7 +39,7 @@ def create_app() -> Flask:
|
|||
# Load sample configuation
|
||||
if app.debug:
|
||||
load_dotenv(
|
||||
Path(__file__).parent.parent / '.env'
|
||||
Path(__file__).parent.parent / '.env_debug'
|
||||
)
|
||||
# Get the token from environment
|
||||
# or generate it using secrets
|
||||
|
|
|
@ -9,7 +9,9 @@ from pymysql.cursors import Cursor
|
|||
|
||||
from . import exts
|
||||
|
||||
# SQL table name (used for the sample page)
|
||||
TABLE = '${REPO_NAME_SNAKE}'
|
||||
|
||||
db_obj: List[Optional[Connection]] = [None]
|
||||
|
||||
|
||||
|
|
|
@ -4,4 +4,6 @@ from flaskext.mysql import MySQL # type: ignore
|
|||
|
||||
|
||||
sql = MySQL(autocommit=True)
|
||||
|
||||
# Add your extensions here
|
||||
exts = [sql]
|
||||
|
|
Loading…
Add table
Reference in a new issue