上一页 1 ··· 39 40 41 42 43 44 45 46 47 ··· 78 下一页
摘要: 中间件简介: 中间件是在 wsgi.py 之后,urls.py 之前,在全局操作 Django 请求和响应的模块 在 settings.py 中可以看到中间件的相关配置 该列表中的每一个元素都是一个类,一个中间件 例如: django.middleware.csrf.CsrfViewMiddlewa 阅读全文
posted @ 2019-09-11 18:37 Sch01aR# 阅读(2362) 评论(0) 推荐(0)
摘要: app01/models.py: from django.db import models class UserInfo(models.Model): username = models.CharField(max_length=16) password = models.CharField(max 阅读全文
posted @ 2019-09-10 20:51 Sch01aR# 阅读(1658) 评论(0) 推荐(0)
摘要: reg2.html: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>注册页面</title> <link rel="stylesheet" href="/static/bootstrap/css/boots 阅读全文
posted @ 2019-09-10 18:06 Sch01aR# 阅读(562) 评论(0) 推荐(0)
摘要: app01/models.py: from django.db import models class UserInfo(models.Model): username = models.CharField(max_length=16) password = models.CharField(max 阅读全文
posted @ 2019-09-07 16:45 Sch01aR# 阅读(701) 评论(0) 推荐(0)
摘要: app01/models.py: from django.db import models class UserInfo(models.Model): username = models.CharField(max_length=16) password = models.CharField(max 阅读全文
posted @ 2019-09-07 15:16 Sch01aR# 阅读(310) 评论(0) 推荐(0)
摘要: reg2 函数: from django.shortcuts import render, HttpResponse from app01 import models def reg2(request): form_obj = RegForm() # GET 请求 if request.method 阅读全文
posted @ 2019-09-06 22:01 Sch01aR# 阅读(698) 评论(0) 推荐(0)
摘要: 邮箱: views.py: from django import forms from django.forms import widgets class RegForm(forms.Form): email = forms.EmailField( label="邮箱", widget=widget 阅读全文
posted @ 2019-09-05 22:39 Sch01aR# 阅读(543) 评论(0) 推荐(0)
摘要: 普通 form 表单的处理: reg.html: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>注册页面</title> </head> <body> <form action="/reg/" method 阅读全文
posted @ 2019-09-05 18:32 Sch01aR# 阅读(606) 评论(0) 推荐(0)
摘要: SweetAlert Github:https://github.com/lipis/bootstrap-sweetalert 下载完后放入 /static/ 目录下 sweetalert.html: <!DOCTYPE html> <html lang="en"> <head> <meta cha 阅读全文
posted @ 2019-09-04 23:10 Sch01aR# 阅读(846) 评论(0) 推荐(0)
摘要: app01/__int__.py: import pymysql pymysql.install_as_MySQLdb() app01/models.py: from django.db import models class Person(models.Model): name = models. 阅读全文
posted @ 2019-09-03 22:11 Sch01aR# 阅读(230) 评论(0) 推荐(0)
上一页 1 ··· 39 40 41 42 43 44 45 46 47 ··· 78 下一页