forked from jzhonx/junzhou365_com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
factory.py
33 lines (25 loc) · 911 Bytes
/
factory.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from config import config
import sys
from os import path
import logging
sys.path.insert(0, path.dirname(path.dirname(path.abspath(__file__))))
sys.path.insert(0, path.dirname(path.abspath(__file__)))
sys.path.append('/vagrant/Projects/tushare') # tushare path
app = Flask(__name__, static_folder='static')
db = SQLAlchemy()
def create_app(config_name):
app = Flask(__name__)
app.config.from_object(config[config_name])
config[config_name].init_app(app)
db.init_app(app)
from redirectToResume import home
app.register_blueprint(home)
from resume import resume
app.register_blueprint(resume, url_prefix='/resume')
from catalog import catalog
app.register_blueprint(catalog, url_prefix='/catalog')
from mystock import stock
app.register_blueprint(stock, url_prefix='/stock')
return app