摘要: from django.db import models # Create your models here. class Book(models.Model): name=models.CharField(max_length=32) pubDate=models.DateField() pric 阅读全文
posted @ 2017-11-02 15:58 Cool· 阅读(175) 评论(0) 推荐(0) 编辑
摘要: ''' 批量导入数据:bulk_create Booklist=[] for i in range(100): Booklist.append(Book(title="book"+str(i),price=30+i*i)) Book.objects.bulk_create(Booklist) ''' 分页器的使用: fro... 阅读全文
posted @ 2017-11-02 15:49 Cool· 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 一、auth模块from django.contrib import authdjango.contrib.auth中提供了许多方法,这里主要介绍其中的三个:1 、authenticate() 提供了用户认证,即验证用户名以及密码是否正确,一般需要username password两个关键字参数如果 阅读全文
posted @ 2017-11-02 15:34 Cool· 阅读(209) 评论(0) 推荐(0) 编辑