Skip to content

Commit

Permalink
Improve bad code example in README (#1281)
Browse files Browse the repository at this point in the history
* Fix bad code example in README

* Ran doctoc

* doctoc thinks bare comments within code blocks must belong in TOC - used inline comment as workaround
  • Loading branch information
javulticat authored Nov 9, 2023
1 parent 10316af commit dd5d1f3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1196,14 +1196,13 @@ If you want to use native AWS Lambda environment variables you can use the `aws_
During development, you can add your Zappa defined variables to your locally running app by, for example, using the below (for Django, to manage.py).

```python
if 'SERVERTYPE' in os.environ and os.environ['SERVERTYPE'] == 'AWS Lambda':
import json
import os
import json
import os

if os.environ.get('AWS_LAMBDA_FUNCTION_NAME') is None: # Ensures app is NOT running on Lambda
json_data = open('zappa_settings.json')
env_vars = json.load(json_data)['dev']['environment_variables']
for key, val in env_vars.items():
os.environ[key] = val

os.environ.update(env_vars)
```

#### Remote Environment Variables
Expand Down

0 comments on commit dd5d1f3

Please sign in to comment.