django解决跨域问题 1 使用第三方模块django-cors-headers 1.1 安装 pip install django-cors-headers 1.2 配置 INSTALLED_APPS = [ 'corsheaders', ] MIDDLEWARE = [ 'corsheader ...
分类:
其他好文 时间:
2020-11-23 12:10:55
阅读次数:
6
WSGI(Python Web Server Gateway Interface) 为 Web Server 和 Python Web Application 之间提供了标准的数据通道. 是 Python 界的 一个广泛的可用的 WEB API 规范, 使 web server 提供更加规范的 AP ...
分类:
编程语言 时间:
2020-11-23 12:07:14
阅读次数:
9
DJango中提供了“信号调度”,用于在框架执行操作时解耦 一些动作发生的时候,系统会根据信号定义的函数执行响应的操作 一 Django中内置的signal Model_signals pre_init # Django中的model对象执行其构造方法前,自动触发 post_init # Djang ...
分类:
其他好文 时间:
2020-11-21 12:35:56
阅读次数:
7
1.models.py class Users(models.Model): password = models.CharField(max_length=100,verbose_name='用户名') account = models.CharField(max_length=100,verbos ...
分类:
数据库 时间:
2020-11-21 12:09:40
阅读次数:
11
目录 1.定位自带密码设置函数/usr/local/python3/lib/python3.6/site-packages/django/contrib/auth/views.py @sensitive_post_parameters() @csrf_protect @login_required ...
分类:
其他好文 时间:
2020-11-21 11:42:26
阅读次数:
9
Django中-事务操作 事务干货:https://zhuanlan.zhihu.com/p/93067082 事务使用:https://www.cnblogs.com/oklizz/p/11240212.html \(~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ...
分类:
其他好文 时间:
2020-11-19 13:01:14
阅读次数:
19
首先新建一个users应用,编写这个应用的models类。 from django.contrib.auth.models import AbstractUser class UserProfile(AbstractUser): ''' 用户 ''' name=models.CharField(ma ...
分类:
其他好文 时间:
2020-11-19 12:52:05
阅读次数:
10
#1.一些重要概念 https://www.cnblogs.com/xiaonq/p/8932266.html ##1.1web容器 什么是web容器 1.web容器是帮助我们部署java丶php丶python丶vue等项目的 作用(处理请求,返回数据) 1.第一,帮助django服务端处理客户端连 ...
分类:
其他好文 时间:
2020-11-19 12:43:44
阅读次数:
14
防止sql注入 char *sqlite3_mprintf(const char*,...); void sqlite3_free(void*); sqlite3_mprintf 用来代替sprintf 来防止sql注入。 sqlite3_mprintf的内部操作: ?会将%Q,替换成给定的字符串。 ...
分类:
数据库 时间:
2020-11-19 12:42:05
阅读次数:
11
1、HttpRequest对象的属性和方法 http请求:HttpRequest对象 def seetl(request): request.path # 请求页面全路径(不包括域名)request.get_full_path()请求路径中会加入相关参数(针对于GET请求) request.meth ...
分类:
其他好文 时间:
2020-11-18 12:41:46
阅读次数:
7