예제 #1
0
파일: manage.py 프로젝트: Clarity-89/blog
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'
예제 #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'
예제 #3
0
파일: manage.py 프로젝트: sanopa/youpin
def create_db():
    db.create_all()
예제 #4
0
파일: manage.py 프로젝트: tstapler/djcyko
def create_db():
    db.create_all()
예제 #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()