Ejemplo n.º 1
0
def app():
    app = create_app()
    app.config.from_object(TestConfig)
    with app.app_context():
        db.create_all()
        yield app
        db.session.remove()  # looks like db.session.close() would work as well
        db.drop_all()
Ejemplo n.º 2
0
 def setUpClass(cls):
     app = create_app()
     ctx = app.app_context()
     ctx.push()
     db.drop_all()
     db.create_all()
     create_users()
     create_products()
Ejemplo n.º 3
0
def main():
    app = create_app()
    ctx = app.app_context()
    ctx.push()
    db.drop_all()
    db.create_all()
    create_superuser()
    create_products()
Ejemplo n.º 4
0
from WebApp import create_app, db, bcrypt
from WebApp.models import User, Link, Role, access
import json

db.create_all(app=create_app())
app = create_app()

# import JSON file  #
with open('site.json', 'r') as json_file:
    json_data = json_file.read()
    print(json_data)
    data = json.loads(json_data)
    #print(data)
    #for d in data['link1']:
    #    print(d.group)

# parse JSON file #

# Sort Json content into table groups #

# remove table attribute from each object #

ctx = app.app_context()
ctx.push()

# for loop through each table group #
# for each object in group create based on that table's lable#

#in try except block#

ctx.pop()
Ejemplo n.º 5
0
def create_database(app):
    with app.app_context():
        print("[+] Creating all current database")
        db.create_all()
Ejemplo n.º 6
0
# -*- coding: utf-8 -*-

from WebApp import db

db.create_all()
Ejemplo n.º 7
0
from WebApp import db, create_app

app = create_app()

with app.app_context():
    db.create_all()