1
1
Fork 0

forgot to commit admin panel disable

dev
Jan Kužílek 5 years ago
parent 79544ecc96
commit 713f565e26

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

Loading…
Cancel
Save