File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import os
22import sys
3+ import warnings
34
45def read_dotenv (dotenv = None ):
56 """
@@ -12,10 +13,7 @@ def read_dotenv(dotenv=None):
1213 frame = sys ._getframe ()
1314 dotenv = os .path .join (os .path .dirname (frame .f_back .f_code .co_filename ), '.env' )
1415 if not os .path .exists (dotenv ):
15- raise EnvironmentError ("%s doesn't exist. You may need to "
16- "explicitly pass the path to .env to "
17- "read_dotenv()." % dotenv )
18-
16+ warnings .warn ("not reading %s - it doesn't exist." % dotenv )
1917 for k , v in parse_dotenv (dotenv ):
2018 os .environ .setdefault (k , v )
2119
Original file line number Diff line number Diff line change 33setup (
44 name = "django-dotenv" ,
55 description = "foreman reads from .env. manage.py doesn't. Let's fix that." ,
6- version = "1.0 " ,
6+ version = "1.1 " ,
77 author = "Jacob Kaplan-Moss" ,
88 author_email = "jacob@jacobian.org" ,
99 url = "http://github.com/jacobian/django-dotenv" ,
You can’t perform that action at this time.
0 commit comments