From 3545f8f8ca18a03f37387f890205083c64b4d616 Mon Sep 17 00:00:00 2001 From: pi3c Date: Wed, 20 Sep 2023 17:11:49 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D1=87=D0=B8=D1=81=D1=82=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BE=D1=82=20=D0=BC=D1=83=D1=81=D0=BE=D1=80=D0=B0=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BF=D0=B8=D0=BF=D0=B0=D1=81=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproger/app.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/pyproger/app.py b/pyproger/app.py index b458147..162d795 100644 --- a/pyproger/app.py +++ b/pyproger/app.py @@ -1,6 +1,4 @@ -import os - -from flask import Flask, render_template_string, request, url_for +from flask import Flask, render_template_string, url_for from flask_admin import helpers from flask_ckeditor import CKEditor from flask_migrate import Migrate @@ -18,12 +16,6 @@ def create_app(test_config=None): else: app.config.from_mapping(test_config) - # Проверям/создаем папку instanse - try: - os.makedirs(app.instance_path) - except OSError: - pass - db.init_app(app) ckeditor = CKEditor() @@ -40,10 +32,10 @@ def create_app(test_config=None): from pyproger.admin.views import PostView, RoleView, TagView, UserView - admin.add_view(RoleView(Role, db.session, category="admin")) - admin.add_view(UserView(User, db.session, category="admin")) - admin.add_view(TagView(Tag, db.session, category="posts")) - admin.add_view(PostView(Post, db.session, category="posts")) + admin.add_view(RoleView(Role, db.session, category="Пользователи")) + admin.add_view(UserView(User, db.session, category="Пользователи")) + admin.add_view(TagView(Tag, db.session, category="Посты")) + admin.add_view(PostView(Post, db.session, category="Посты")) from pyproger.cli.commands import bp_cli