-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
38 lines (29 loc) · 1.13 KB
/
app.py
File metadata and controls
38 lines (29 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import os
from flask import Flask
from jinja2 import ChoiceLoader, FileSystemLoader
from routes.main_routes import main_bp
from routes.api_routes import api_bp
def create_app():
app = Flask(__name__)
# Allow loading templates from both 'templates' and 'tools' folders
app.jinja_loader = ChoiceLoader([
FileSystemLoader(os.path.join(app.root_path, 'templates')),
FileSystemLoader(os.path.join(app.root_path, 'tools'))
])
# Register Blueprints
app.register_blueprint(main_bp)
app.register_blueprint(api_bp)
# Diagnostic: Check if loaded from source or binary
import routes.api_routes as ar
import logic.license_manager as lm
print(f"[*] API Routes Loaded From: {ar.__file__}")
print(f"[*] License Manager Loaded From: {lm.__file__}")
return app
if __name__ == '__main__':
app = create_app()
# 로컬 실행 최적화
print("------------------------------------------")
print("drawNET Premium Server Starting...")
print("URL: http://127.0.0.1:5000")
print("------------------------------------------")
app.run(debug=True, port=5000)