随笔分类 -  django

Can't run remote python interpreter: Can't get remote credentials for deployment server pyvip@127.0.0.1:22 Pycharm运行 django服务
摘要:3个步骤: 1. 2、 3. 阅读全文

posted @ 2020-10-13 15:29 卓达 阅读(3203) 评论(0) 推荐(0)

pyspider 安装
摘要:1. sudo apt --update 2.sudo apt --upgrade 3. sudo apt-get install ......大一推依赖包。看pyspider 官网 4.创建虚拟环境 5.pip install pyspider 6.pip install pyspider[all 阅读全文

posted @ 2019-08-29 14:25 卓达 阅读(198) 评论(0) 推荐(0)

Django modle基础样版
摘要:定义一个基类模版, from django.db import models class ModelBase(models.Model): """ """ create_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间") update_time = models.Date... 阅读全文

posted @ 2019-08-05 16:07 卓达 阅读(169) 评论(0) 推荐(0)

doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
摘要:在settings.py中增加 问题就解决了。什么原因。——不知道。。 具体请看: https://stackoverflow.com/questions/35388637/runtimeerror-model-class-django-contrib-sites-models-site-doesn 阅读全文

posted @ 2019-06-18 10:21 卓达 阅读(2872) 评论(0) 推荐(0)

django 搜索引擎 Elasticsearch 安装使用
摘要:1.使用docker安装elasticsearch a.获取镜像 b.将百度云盘中的elasticsearch.zip文件传到虚拟机中的家目录,然后unzip解压。在虚拟机中的elasticsearch/config/elasticsearch.yml第54行,更改ip地址为0.0.0.0,端口改为 阅读全文

posted @ 2019-06-13 10:45 卓达 阅读(1202) 评论(0) 推荐(0)

django 新项目
摘要:1.创建虚拟环境 mkvirtualenv - p python3 pip list 查询已经安装的包 pip install django==2.1.7 安装包 指定版本的包 1.1 删除虚拟环境、 rmvirtualenv 虚拟环境名 rmvirtualenv site1 1.2 workon 阅读全文

posted @ 2019-05-27 18:29 卓达 阅读(124) 评论(0) 推荐(0)

django settings.py
摘要:"""Django settings for mysite project.Generated by 'django-admin startproject' using Django 2.1.7.For more information on this file, seehttps://docs.d 阅读全文

posted @ 2019-05-27 11:51 卓达 阅读(333) 评论(2) 推荐(0)

jquery.js:9600 POST http://127.0.0.1:8000/news/1/comments/ 500 (Internal Server Error)
摘要:什么情况? 代码报错了....查询 语句错误 看 编译提示. 数据 查询 语句的问题!!!! 阅读全文

posted @ 2019-05-08 16:13 卓达 阅读(1606) 评论(0) 推荐(0)

jajx 传参 需要 判断的 条件
摘要:1.有没有权限. 2.数据类型 对不对 例如 id ,page 传过来时是str 类型, view中处理时需要转换成 int类型. 如果 不能转 就会报错.. 3.查询数据.数据不存在也要报错... 内容符不符合要求. 4 以上条件都满足并得到结果.返 对应格式的数据. 阅读全文

posted @ 2019-05-05 09:28 卓达 阅读(163) 评论(0) 推荐(0)

get() got an unexpected keyword argument
摘要:TypeError: get() got an unexpected keyword argument 'news_id'ERROR basehttp 154 "GET /news/3/ HTTP/1.1" 500 70524 原因 Url 和 . 视图 不对头...... 阅读全文

posted @ 2019-04-29 17:53 卓达 阅读(21489) 评论(1) 推荐(0)

model 字段参数 choice
摘要:choices 字段选择限制.类型于'枚举' 阅读全文

posted @ 2019-04-29 09:13 卓达 阅读(505) 评论(0) 推荐(0)

ajax 常用功能 结构分解
摘要:ajax 和后台交互基本结构 0.触发的事件. 1.获取参数 2.url 3.请求方法get/post 4.对返回结果的处理 .done如果有返加 .fail 失败 阅读全文

posted @ 2019-04-28 09:08 卓达 阅读(426) 评论(0) 推荐(0)

AttributeError: 'LoginForm' object has no attribute 'is_bound' , object has no attribute 'is_bound'
摘要:可能原因: 啥子问题?? 都是 jquery.js 文件..... 阅读全文

posted @ 2019-04-22 16:49 卓达 阅读(605) 评论(0) 推荐(0)

Django form表单功能的引用(注册,复写form.clean方法 增加 验证密码功能)
摘要:1. 在app下 新建 forms.py 定义表单内容,类型models 2. 定义视图,实例化form表单,传到前端 3. 新增url 及 前端 html模板 阅读全文

posted @ 2019-03-22 18:52 卓达 阅读(293) 评论(0) 推荐(0)

django 环境配置.
摘要:1. 一个虚拟环境对应一个 dajngo项目 2. mkvirtruenv pycham 创建Pure Python 新项目,不是Django 2018.3 其他版本 3. Add Configuration -1.add Django server 2018.3 -2.Environment Va 阅读全文

posted @ 2019-03-10 10:54 卓达 阅读(727) 评论(6) 推荐(0)

Django 学生信息 添加 功能 遇到的问题.
摘要:1 添加 班级信息时的问题 (grade为外键) 原因是 grade 必需接收 一个 实例, 而我交是一个 str字符串, 加了一个.first() 后 正常... 下面有常用查询 和返回的类型. 3.常用查询 通过模型类上的管理器来构造QuerySet。 - 模型类上的管理器是啥? 模型类.obj 阅读全文

posted @ 2019-03-05 18:09 卓达 阅读(237) 评论(0) 推荐(0)

django models表关系
摘要:表关系 :一对一 阅读全文

posted @ 2019-03-04 09:39 卓达 阅读(195) 评论(0) 推荐(0)

Django 的ORM 数据操作
摘要:1.常用的模型字段类型 https://docs.djangoproject.com/en/2.1/ref/models/fields/#field-types 2.字段的常用参数官方文档:https://docs.djangoproject.com/en/2.1/ref/models/fields 阅读全文

posted @ 2019-02-26 17:18 卓达 阅读(906) 评论(0) 推荐(0)

django 数据库配置 ,APP 迁移.模型基础
摘要:1.数据库的连接配置django 连接mysql的配置流程:- 安装 pymysql pip install pymysql- 创建数据库用户有创建数据库权限的用户- 创建数据库crm - 修改配置settins- 修改项目文件夹(和settings.py文件所在的目录)下__init__.py 文 阅读全文

posted @ 2019-02-24 20:38 卓达 阅读(321) 评论(0) 推荐(0)

导航