Ejemplo n.º 1
0
def init_db():
    db.create_all()
    password = pwd_context.encrypt('111111')
    u = User(username='******', email='*****@*****.**', password_hash=password)
    p = Post(title='First post', slug='first-post',
                        body="Welcome to my blog. I will be putting up posts about various topics, so make sure to check back soon.",
                        author=u)
    db.session.add(u)
    db.session.add(p)
    db.session.commit()
    print 'Initialized the db'
Ejemplo n.º 2
0
def init_db():
    db.create_all()
    password = pwd_context.encrypt('111111')
    u = User(username='******', email='*****@*****.**', password_hash=password)
    p = Post(
        title='First post',
        slug='first-post',
        body=
        "Welcome to my blog. I will be putting up posts about various topics, so make sure to check back soon.",
        author=u)
    db.session.add(u)
    db.session.add(p)
    db.session.commit()
    print 'Initialized the db'
Ejemplo n.º 3
0
def create_db():
    db.create_all()
Ejemplo n.º 4
0
def create_db():
    db.create_all()
Ejemplo n.º 5
0
 def setUp(self):
     angular_flask.app.config.from_object('angular_flask.settings.TestingConfig')
     self.db_fd, angular_flask.app.config['DATABASE'] = tempfile.mkstemp()
     self.app = angular_flask.app.test_client()
     db.create_all()