File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ resource appService 'Microsoft.Web/sites@2024-04-01' = {
6262 httpsOnly : true
6363 siteConfig : {
6464 linuxFxVersion : 'PYTHON|3.12'
65- appCommandLine : 'bash startup.sh '
65+ appCommandLine : 'python -m gunicorn --bind=0.0.0.0:8000 --workers=2 --timeout=600 main:app '
6666 appSettings : [
6767 {
6868 name : 'SECRET_KEY'
Original file line number Diff line number Diff line change 99
1010# Import after path setup to avoid linting issues
1111from src .app import create_app # noqa: E402
12+ from src .models import db # noqa: E402
1213
1314app = create_app ()
1415
16+ # Initialize database tables
17+ with app .app_context ():
18+ db .create_all ()
19+
1520if __name__ == '__main__' :
1621 app .run (debug = False , host = '0.0.0.0' , port = 8000 )
Original file line number Diff line number Diff line change @@ -18,17 +18,17 @@ def create_app():
1818 # Get the absolute path to the project root
1919 current_dir = os .path .dirname (os .path .abspath (__file__ ))
2020 project_root = os .path .dirname (current_dir )
21-
21+
2222 # Set paths relative to the project structure
2323 static_folder = os .path .join (project_root , 'static' )
2424 template_folder = os .path .join (current_dir , 'templates' )
25-
25+
2626 app = Flask (
2727 __name__ ,
2828 static_folder = static_folder ,
2929 template_folder = template_folder
3030 )
31-
31+
3232 # Configuration
3333 app .config ['SECRET_KEY' ] = os .environ .get ('SECRET_KEY' , 'dev-secret-key' )
3434 app .config ['SQLALCHEMY_DATABASE_URI' ] = os .environ .get (
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments