Skip to content

Commit 0b59701

Browse files
committed
Fixed init module path
1 parent acc1859 commit 0b59701

File tree

3 files changed

+27
-25
lines changed

3 files changed

+27
-25
lines changed

webapp-v0/webapp/__init__.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@
55

66
app = Flask(__name__)
77

8-
app.config['SECRET_KEY'] = '056e0820604e3c45b8908388be1fcaf8'
9-
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://pinehead:pinehead@localhost/pinehead'
8+
app.config["SECRET_KEY"] = "056e0820604e3c45b8908388be1fcaf8"
9+
app.config["SQLALCHEMY_DATABASE_URI"] = "mysql://pinehead:pinehead@localhost/pinehead"
1010
app.config["SQLALCHEMY_ECHO"] = True
1111

1212
db = SQLAlchemy(app)
1313

1414
bcrypt = Bcrypt(app)
1515

1616
login_manager = LoginManager(app)
17-
login_manager.login_view = 'login'
18-
login_manager.login_message_category = 'info'
17+
login_manager.login_view = "login"
18+
login_manager.login_message_category = "info"
1919

20-
from webapp import routes # must be the last line
20+
# this line must be last in this file to avoid circular imports
21+
from webapp import routes # noqa: F401,E402

webapp-v2/__init__.py

-20
This file was deleted.

webapp-v2/webapp/__init__.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import os
2+
3+
from flask import Flask
4+
from flask_bcrypt import Bcrypt
5+
from flask_login import LoginManager
6+
7+
8+
app = Flask(__name__)
9+
10+
app.config["SECRET_KEY"] = "056e0820604e3c45b8908388be1fcaf8"
11+
app.s3_prefix = os.environ["S3_PREFIX"]
12+
print(f" * Album art using S3 bucket prefix {app.s3_prefix}")
13+
14+
bcrypt = Bcrypt(app)
15+
16+
login_manager = LoginManager(app)
17+
login_manager.login_view = "login"
18+
login_manager.login_message_category = "info"
19+
20+
# this line must be last in this file to avoid circular imports
21+
from webapp import routes # noqa: F401,E402

0 commit comments

Comments
 (0)