You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONFIG.md
+33-15Lines changed: 33 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,12 @@
1
1
# Configuration System
2
2
3
-
This Python template includes a Laravel-inspired configuration system that allows you to manage application settings through Python files and environment variable overrides.
3
+
This Python template includes a Laravel-inspired configuration system that allows you to manage application settings through Python files and settings overrides.
4
4
5
5
## Features
6
6
7
7
-**Multiple Config Files**: Organize your configuration into separate Python files (e.g., `app.py`)
8
-
-**Environment Overrides**: Use `.env` file or environment variables to override config values
8
+
-**Settings Overrides**: Use `config/settings.py` file or environment variables to override config values
9
+
-**Bundled Settings**: Settings are bundled with the application binary (no external .env files needed)
@@ -112,10 +129,11 @@ value = helpers.env('app.name') # Falls back to config if no env var
112
129
## Best Practices
113
130
114
131
1.**Organize by Feature**: Create separate config files for different aspects (database, mail, cache, etc.)
115
-
2.**Use Environment Variables**: For sensitive data and environment-specific settings
116
-
3.**Provide Defaults**: Always provide sensible default values
117
-
4.**Document Settings**: Add comments to explain complex configuration options
118
-
5.**Validate Config**: Add validation for critical configuration values in your application startup
132
+
2.**Use Settings File**: For non-sensitive application-specific overrides that should be bundled
133
+
3.**Use Environment Variables**: For sensitive data and deployment-specific settings
134
+
4.**Provide Defaults**: Always provide sensible default values
135
+
5.**Document Settings**: Add comments to explain complex configuration options
136
+
6.**Validate Config**: Add validation for critical configuration values in your application startup
119
137
120
138
## Example: Full Configuration Workflow
121
139
@@ -141,4 +159,4 @@ if helpers.get_config('app.env') == 'testing':
141
159
helpers.set_config('database.default', 'sqlite')
142
160
```
143
161
144
-
This configuration system provides the flexibility of Laravel's config system while maintaining Python's simplicity and power.
162
+
This configuration system provides the flexibility of Laravel's config system while maintaining Python's simplicity and power. Settings are now bundled with the application for easier distribution.
0 commit comments