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
In production environment, you might not need `manage.py` to run your application server. In that case, you need to put the code on `wsgi.py` like this:
35
+
from django.core.management import execute_from_command_line
31
36
37
+
execute_from_command_line(sys.argv)
32
38
```
39
+
40
+
You can also pass `read_dotenv()` an explicit path to the `.env` file, or to the directory where it lives. It's smart, it'll figure it out.
41
+
42
+
Check out [tests.py][tests-py] to see all the supported formats that your `.env` can have.
43
+
44
+
### Using with WSGI
45
+
46
+
If you're running Django with WSGI and want to load a `.env` file, your `wsgi.py` would look like this:
0 commit comments