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
First, transform the settings.py into a directory containing individual settings files for development, production, and testing. Here's the structure you'll create:
5
+
6
+
```bash
7
+
8
+
backend/
9
+
backend/
10
+
settings/
11
+
__init__.py
12
+
base.py # Common settings
13
+
development.py # Development-specific settings
14
+
production.py # Production-specific settings
15
+
testing.py # Testing-specific settings
16
+
```
17
+
18
+
- base.py: Contains settings common to all environments (e.g., INSTALLED_APPS, MIDDLEWARE).
19
+
- development.py: Settings for the development environment (e.g., DEBUG = True, database configurations for development).
python manage.py test --settings=backend.settings.testing
51
+
```
52
+
53
+
<br>
54
+
55
+
You can also set the DJANGO_SETTINGS_MODULE environment variable in your development, production, or CI/CD environment to point to the correct settings module, simplifying command usage.
0 commit comments