mirror of
https://github.com/laurentS/slowapi.git
synced 2026-03-13 09:10:20 +08:00
Merge pull request #4 from brumar/patch-1
Add missing import in the readme
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user