mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-02-08 15:34:56 +08:00
26 lines
480 B
Markdown
26 lines
480 B
Markdown
|
|
# Python Security
|
||
|
|
|
||
|
|
> This file extends [common/security.md](../common/security.md) with Python specific content.
|
||
|
|
|
||
|
|
## Secret Management
|
||
|
|
|
||
|
|
```python
|
||
|
|
import os
|
||
|
|
from dotenv import load_dotenv
|
||
|
|
|
||
|
|
load_dotenv()
|
||
|
|
|
||
|
|
api_key = os.environ["OPENAI_API_KEY"] # Raises KeyError if missing
|
||
|
|
```
|
||
|
|
|
||
|
|
## Security Scanning
|
||
|
|
|
||
|
|
- Use **bandit** for static security analysis:
|
||
|
|
```bash
|
||
|
|
bandit -r src/
|
||
|
|
```
|
||
|
|
|
||
|
|
## Reference
|
||
|
|
|
||
|
|
See skill: `django-security` for Django-specific security guidelines (if applicable).
|