标签:model code div max import 创建 rac gis dmi
1、在admin.py文件中注册需要创建的表,例:
from .models import * # Register your models here. admin.site.register(Userinfo) admin.site.register(Travel) admin.site.register(Driver) admin.site.register(Bus)
2、在settings.py文件中配置AUTH_USER_MODEL = ‘car.Userinfo‘,(car是app名字,Userinfo是类名)
3、创建表
from django.contrib.auth.models import AbstractUser # Create your models here. class Userinfo(AbstractUser): alias=models.CharField(max_length=32,blank=True) dep = models.CharField(max_length=32,blank=True) telphone=models.IntegerField(blank=True,null=True) def __str__(self): return self.alias class Travel(models.Model): class Bus(models.Model): class Driver(models.Model):
标签:model code div max import 创建 rac gis dmi
原文地址:https://www.cnblogs.com/xwupiaomiao/p/9441805.html