刚开始学django,创建的第一个web工程无法启动,后来发现是由于教程是针对较低版本的Django,我用的是Django2.X和Python3.7,urls文件设置方法和旧版本不一致,按照之前的版本设置,报错信息为TypeError: view must be a callable or a list/tuple in the case of include().. 默认的urls文件配置: from django.conf.urls import url urlpatterns =
1.在app的models.py中添加以下代码: from django.db import models # Create your models here. # Register your models here. class UserType(models.Model): name = models.CharField(max_length=32) class UserInfo(models.Model): username = models.CharField(max_length=32