shouldn't we give the parameter a higher priority than the env var?

How about

```python
if url is None:
    url = os.environ.get('DATABASE_URL', url)
```
?