Skip to content

Commit

Permalink
improve gunicorn.saenv file
Browse files Browse the repository at this point in the history
  • Loading branch information
ali96343 committed Oct 28, 2023
1 parent 6a6529c commit c73fc6e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions py4web/server_adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@ def get_gunicorn_vars(self, env_file="gunicorn.saenv"):
if os.path.isfile(env_file):
try:
with open(env_file, "r") as f:
lines = f.read().splitlines()
lines = f.read().splitlines()
for line in lines:
line = line.strip()
if not line or line.startswith("#"):
continue
line = line.replace("export", "").replace(
"GUNICORN_", ""
)
key, value = line.split("=",1)
result[key.strip().lower()] = value.strip()
for k in ( "export", "GUNICORN_" ):
line = line.replace(k, '')
k, v = line.split("=",1)
result[k.strip().lower()] = v.strip()
if result:
print(f"gunicorn: read {env_file}")
return result
Expand Down

0 comments on commit c73fc6e

Please sign in to comment.