This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from .. import db, flask_bcrypt | |
| class User(db.Model): | |
| """ User Model for storing user related details """ | |
| __tablename__ = "user" | |
| id = db.Column(db.Integer, primary_key=True, autoincrement=True) | |
| email = db.Column(db.String(255), unique=True, nullable=False) | |
| registered_on = db.Column(db.DateTime, nullable=False) | |
| admin = db.Column(db.Boolean, nullable=False, default=False) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import unittest | |
| from flask_migrate import Migrate, MigrateCommand | |
| from flask_script import Manager | |
| from app.main import create_app, db | |
| app = create_app(os.getenv('BOILERPLATE_ENV') or 'dev') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import Flask | |
| from flask_sqlalchemy import SQLAlchemy | |
| from flask_bcrypt import Bcrypt | |
| from .config import config_by_name | |
| db = SQLAlchemy() | |
| flask_bcrypt = Bcrypt() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| # uncomment the line below for postgres database url from environment variable | |
| # postgres_local_base = os.environ['DATABASE_URL'] | |
| basedir = os.path.abspath(os.path.dirname(__file__)) | |
| class Config: | |
| SECRET_KEY = os.getenv('SECRET_KEY', 'my_precious_secret_key') | |
| DEBUG = False |
NewerOlder