![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Django
若竹丶
这个作者很懒,什么都没留下…
展开
-
django中models模型
1、创建数据库模型from django.db import models# Create your models here.class Grade(models.Model): g_name = models.CharField(max_length=32)class Student(models.Model): s_name = models.CharField(max...原创 2020-03-22 16:52:29 · 131 阅读 · 0 评论 -
django连接MySQL
1、根目录-setting中进行连接配置engine:引擎,驱动name:数据库名字user:用户名password:密码host:连接地址(本机:localhost)port:端口2、在__init__.py中进行伪装MySQLdbimport pymysqlpymysql.install_as_MySQLdb()...原创 2020-03-22 16:49:47 · 94 阅读 · 0 评论 -
django基础
1、创建项目django-admin startproject <项目名>2、setting配置# 模板文件配置TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR, 'te...原创 2020-03-21 12:10:34 · 85 阅读 · 0 评论