Merge pull request #4 from brumar/patch-1

Add missing import in the readme
This commit is contained in:
Laurent Savaete
2020-05-11 14:23:27 +00:00
committed by GitHub

View File

@@ -19,6 +19,7 @@ $ pip install slowapi
```python
from starlette.applications import Starlette
from slowapi import Limiter, _rate_limit_exceeded_handler
from slowapi.util import get_remote_address
limiter = Limiter(key_func=get_remote_address)
app = Starlette()
@@ -39,6 +40,7 @@ The above app will have a route `t1` that will accept up to 5 requests per minut
```python
from fastapi import FastAPI
from slowapi import Limiter, _rate_limit_exceeded_handler
from slowapi.util import get_remote_address
limiter = Limiter(key_func=get_remote_address)
app = FastAPI()