django models

http://www.runoob.com/django/django-model.html


django-admin startapp TestModel


/models.py

from django.db import models

class Test(models.Model):
name = models.CharField(max_length=20)

 

settings.py

 

$ python manage.py makemigrations TestModel # 让 Django 知道我们在我们的模型有一些变更
$ python manage.py migrate TestModel # 创建表结构

posted @ 2018-11-04 22:29  feiyun8616  阅读(115)  评论(0编辑  收藏  举报