-
-
Notifications
You must be signed in to change notification settings - Fork 597
Open
Description
Is there an existing issue for this?
- I have searched the existing issues
What happened?
Impact: Deployment flexibility, port conflicts, configuration management
Problem:
Ports and URLs are hardcoded throughout the codebase, making it impossible to:
- Run multiple instances on the same machine
- Deploy to cloud platforms with dynamic ports
- Easily switch between dev/staging/production environments
Locations:
main.py:147- Backend port 52123main.py:51- Microservice port 52124settings.py:5- Microservice URL
Recommended Fix:
Create a config.py with environment variables:
import os
class Config:
BACKEND_PORT = int(os.getenv('BACKEND_PORT', '52123'))
MICROSERVICE_PORT = int(os.getenv('MICROSERVICE_PORT', '52124'))
MICROSERVICE_URL = os.getenv('MICROSERVICE_URL', f'http://localhost:{MICROSERVICE_PORT}')
BACKEND_HOST = os.getenv('BACKEND_HOST', 'localhost')Benefits:
- Deploy anywhere without code changes
- No port conflicts
- Easy environment switching (dev/prod)
- Standard Python best practice
Record
- I agree to follow this project's Code of Conduct
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels