django3.0新特性

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

2 django3.0 新特性:
(1)ASGI;
(2)支持MariaDB10.1+
(3)自定义枚举类型(TextChoices,IntegerChoices)

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。

猜你喜欢

转载自blog.51cto.com/jingshengsun888/2496873