thecoderhere commited on
Commit
b8d8ce9
·
verified ·
1 Parent(s): 09d8253

Update app/__init__.py

Browse files
Files changed (1) hide show
  1. app/__init__.py +12 -16
app/__init__.py CHANGED
@@ -1,27 +1,23 @@
1
  # app/__init__.py
2
  from flask import Flask
3
- from pathlib import Path
4
  import logging
5
  import os
6
 
7
- # Set up logging
8
- logging.basicConfig(
9
- level=logging.INFO,
10
- format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
11
- )
12
-
13
  def create_app():
14
  """Create and configure the Flask application"""
15
- app = Flask(__name__)
 
 
 
 
16
 
17
- # Configuration
18
- app.config['SECRET_KEY'] = os.environ.get('SECRET_KEY', 'dev-secret-key-change-in-production')
19
- app.config['DEBUG'] = False # Must be False for Hugging Face
20
-
21
- # Import routes after app is created
22
- from app.routes import main
23
- app.register_blueprint(main)
24
 
25
- logging.info("Flask app created successfully")
 
 
 
26
 
27
  return app
 
1
  # app/__init__.py
2
  from flask import Flask
 
3
  import logging
4
  import os
5
 
 
 
 
 
 
 
6
  def create_app():
7
  """Create and configure the Flask application"""
8
+ # Set up logging
9
+ logging.basicConfig(
10
+ level=logging.INFO,
11
+ format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
12
+ )
13
 
14
+ app = Flask(__name__)
15
+ app.config['SECRET_KEY'] = os.environ.get('SECRET_KEY', 'dev-secret-key')
16
+ app.config['DEBUG'] = False
 
 
 
 
17
 
18
+ # Register routes
19
+ with app.app_context():
20
+ from app.routes import main
21
+ app.register_blueprint(main)
22
 
23
  return app