1
1
Fork 0

More migration shit

dev
Jan Kužílek 5 years ago
parent 4ff472ee2b
commit 53ddb2ab53

@ -21,25 +21,8 @@ assets = AssetsEnvironment()
def create_app():
app = Flask(__name__, instance_relative_config=True)
app.config.from_pyfile('config.py')
app.config.from_mapping(POST_UPLOADS=os.path.join(app.instance_path, 'post'), SQLALCHEMY_TRACK_MODIFICATIONS=False)
# app.config.from_mapping(
# SECRET_KEY='dev',
# #SQLALCHEMY_DATABASE_URI='sqlite:///{}'.format(os.path.join(app.instance_path, 'yadc.db')),
# SQLALCHEMY_DATABASE_URI='postgresql://{}:{}@{}:{}/{}'.format('yadc', 'omegalul', 'localhost', 5432, 'yadc'),
# MAX_CONTENT_LENGTH=10*1024*1024,
# POST_LIST_THUMB_HEIGHT=200,
# POST_UPLOADS=os.path.join(app.instance_path, 'post'),
# INSTANCE_NAME='Darkne.su',
# POSTS_PER_PAGE=8,
# MANAGE_USERS_PER_PAGE=2,
# MANAGE_POSTS_PER_PAGE=2,
# ALLOW_REGISTER=False,
# SQLALCHEMY_ECHO=True,
# )
app.config.from_mapping(POST_UPLOADS=os.path.join(app.instance_path, 'post'), SQLALCHEMY_TRACK_MODIFICATIONS=False)
try:
os.makedirs(app.instance_path)
@ -51,6 +34,9 @@ def create_app():
except OSError:
pass
app.config.from_pyfile('config.py')
db.init_app(app)
migrate.init_app(app, db)
login.init_app(app)

Loading…
Cancel
Save