django3.0新特性

1 django3.0 官方文檔:https://www.djangoproject.com/weblog/2019/dec/02/django-3-released/web

2 django3.0 新特性:
(1)ASGI;
(2)支持MariaDB10.1+
(3)自定義枚舉類型(TextChoices,IntegerChoices)django

3 ASGI:
在django3.0以前django的Web服務器網關接口一直用的是WSGI,ASGI的A就是Async,也就是異步的意思,ASGI簡單的來講就是異步的WSGI。
django3.0新特性服務器

你們看一下,咱們的目錄裏比以前的django2多出了一個asgi.py文件,這個就是以前咱們所說的ASGI組件。
ASGI服務器組件,咱們有兩種應用服務器能夠來啓動它:
    一種是用Uvicorn
    一種是用Daphne
    [命令是同樣的]
    pip install Uvicorn
    uvicorn mysite.asgi:application

    建議使用daphne。
相關文章
相關標籤/搜索