correct indendation
This commit is contained in:
parent
a36e815227
commit
4232f5342e
@ -71,20 +71,20 @@ The following variables are accessible as properties on `Request` objects:
|
|||||||
|
|
||||||
- `app` - a reference to the Sanic application object that is handling this request. This is useful when inside blueprints or other handlers in modules that do not have access to the global `app` object.
|
- `app` - a reference to the Sanic application object that is handling this request. This is useful when inside blueprints or other handlers in modules that do not have access to the global `app` object.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from sanic.response import json
|
from sanic.response import json
|
||||||
from sanic import Blueprint
|
from sanic import Blueprint
|
||||||
|
|
||||||
bp = Blueprint('my_blueprint')
|
bp = Blueprint('my_blueprint')
|
||||||
|
|
||||||
@bp.route('/')
|
@bp.route('/')
|
||||||
async def bp_root(request):
|
async def bp_root(request):
|
||||||
if request.app.config['DEBUG']:
|
if request.app.config['DEBUG']:
|
||||||
return json({'status': 'debug'})
|
return json({'status': 'debug'})
|
||||||
else:
|
else:
|
||||||
return json({'status': 'production'})
|
return json({'status': 'production'})
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Accessing values using `get` and `getlist`
|
## Accessing values using `get` and `getlist`
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user