|
|
@ -6,8 +6,8 @@ from flask_migrate import Migrate
|
|
|
|
from flask_login import LoginManager
|
|
|
|
from flask_login import LoginManager
|
|
|
|
from flask_assets import Environment as AssetsEnvironment, Bundle as AssetsBundle
|
|
|
|
from flask_assets import Environment as AssetsEnvironment, Bundle as AssetsBundle
|
|
|
|
|
|
|
|
|
|
|
|
from flask_admin import Admin
|
|
|
|
# from flask_admin import Admin
|
|
|
|
from flask_admin.contrib.sqla import ModelView
|
|
|
|
# from flask_admin.contrib.sqla import ModelView
|
|
|
|
|
|
|
|
|
|
|
|
db = SQLAlchemy()
|
|
|
|
db = SQLAlchemy()
|
|
|
|
migrate = Migrate()
|
|
|
|
migrate = Migrate()
|
|
|
@ -15,7 +15,7 @@ login = LoginManager()
|
|
|
|
assets = AssetsEnvironment()
|
|
|
|
assets = AssetsEnvironment()
|
|
|
|
|
|
|
|
|
|
|
|
# THIS FUCKER DARES TO MESS WITH MY BLUEPRINTS (that blueprint collision shitxception)
|
|
|
|
# THIS FUCKER DARES TO MESS WITH MY BLUEPRINTS (that blueprint collision shitxception)
|
|
|
|
admin = Admin()
|
|
|
|
# admin = Admin()
|
|
|
|
|
|
|
|
|
|
|
|
def create_app():
|
|
|
|
def create_app():
|
|
|
|
|
|
|
|
|
|
|
@ -47,13 +47,13 @@ def create_app():
|
|
|
|
login.init_app(app)
|
|
|
|
login.init_app(app)
|
|
|
|
assets.init_app(app)
|
|
|
|
assets.init_app(app)
|
|
|
|
|
|
|
|
|
|
|
|
from yadc import models
|
|
|
|
# from yadc import models
|
|
|
|
|
|
|
|
|
|
|
|
admin.init_app(app)
|
|
|
|
# admin.init_app(app)
|
|
|
|
admin.add_view(ModelView(models.User, db.session, endpoint='admin_user'))
|
|
|
|
# admin.add_view(ModelView(models.User, db.session, endpoint='admin_user'))
|
|
|
|
admin.add_view(ModelView(models.Post, db.session, endpoint='admin_post'))
|
|
|
|
# admin.add_view(ModelView(models.Post, db.session, endpoint='admin_post'))
|
|
|
|
admin.add_view(ModelView(models.Tag, db.session, endpoint='admin_tag'))
|
|
|
|
# admin.add_view(ModelView(models.Tag, db.session, endpoint='admin_tag'))
|
|
|
|
admin.add_view(ModelView(models.Comment, db.session, endpoint='admin_comment'))
|
|
|
|
# admin.add_view(ModelView(models.Comment, db.session, endpoint='admin_comment'))
|
|
|
|
|
|
|
|
|
|
|
|
from yadc.bp import main, post, auth, user, api
|
|
|
|
from yadc.bp import main, post, auth, user, api
|
|
|
|
app.register_blueprint(main.bp)
|
|
|
|
app.register_blueprint(main.bp)
|
|
|
|