47 lines
1 KiB
Python
47 lines
1 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Podcastrr - A podcast management application similar to Sonarr but for podcasts.
|
|
"""
|
|
import os
|
|
import logging
|
|
from dotenv import load_dotenv
|
|
from application import create_app
|
|
from app.models.database import db
|
|
|
|
# Load environment variables from .env file
|
|
load_dotenv()
|
|
|
|
# Set up logging
|
|
logging.basicConfig(
|
|
level=logging.INFO,
|
|
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
|
)
|
|
|
|
|
|
def main():
|
|
"""
|
|
Main entry point for the application.
|
|
"""
|
|
# Create the Flask app
|
|
app = create_app()
|
|
|
|
# Database tables are created in application.py
|
|
print("Database tables created successfully!")
|
|
|
|
# Get port from environment variable or use default
|
|
port = int(os.environ.get("PORT", 5000))
|
|
debug = os.environ.get("FLASK_ENV") == "development"
|
|
|
|
print(f"Starting Podcastrr on port {port}")
|
|
print(f"Debug mode: {debug}")
|
|
|
|
# Run the application
|
|
app.run(
|
|
host="0.0.0.0",
|
|
port=port,
|
|
debug=debug
|
|
)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|