Skip to content

Commit 7c364c6

Browse files
blueprint modules renaming
1 parent 5aae1a1 commit 7c364c6

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

system/blueprints.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
def register_blueprints(app):
22
with app.app_context():
3-
from web_site.routes import web_site_routes
4-
from telegram_bot.routes import telegram_blueprint
3+
from web_site.blueprint import web_site_blueprint
4+
from telegram_bot.blueprint import telegram_blueprint
55

6-
app.register_blueprint(web_site_routes)
6+
app.register_blueprint(web_site_blueprint)
77
app.register_blueprint(telegram_blueprint, url_prefix='/telegram')
File renamed without changes.

web_site/blueprint.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from flask import Blueprint, current_app, send_from_directory
2+
3+
4+
DIST_DIR = current_app.config.get('DIST_DIR')
5+
STATIC_DIR = current_app.config.get('STATIC_DIR')
6+
7+
web_site_blueprint = Blueprint(
8+
'web_site_blueprint',
9+
__name__,
10+
static_folder=STATIC_DIR,
11+
static_url_path='/static'
12+
)
13+
14+
15+
@web_site_blueprint.route('/')
16+
def get_index_page():
17+
return send_from_directory(DIST_DIR, 'index.html')

web_site/routes.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)