Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.10/site-packages/django/core/checks/async_checks.py: 62%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

8 statements  

1import os 

2 

3from . import Error, Tags, register 

4 

5E001 = Error( 

6 "You should not set the DJANGO_ALLOW_ASYNC_UNSAFE environment variable in " 

7 "deployment. This disables async safety protection.", 

8 id="async.E001", 

9) 

10 

11 

12@register(Tags.async_support, deploy=True) 

13def check_async_unsafe(app_configs, **kwargs): 

14 if os.environ.get("DJANGO_ALLOW_ASYNC_UNSAFE"): 

15 return [E001] 

16 return []