代码改变世界

随笔档案-2017年06月

django入门篇(开始配置,创建 , ORM 操作)

2017-06-26 19:58 by hl_流星, 237 阅读, 收藏,
摘要: 一,创建django项目: 1,pycharm直接创建 2,执行: 终端命令:django-admin startproject sitename 其他常用命令: python manage.py runserver 0.0.0.0 python manage.py startapp appname 阅读全文

jgango入门之页码

2017-06-26 16:10 by hl_流星, 321 阅读, 收藏,
摘要: 代码如下,但可以考虑优化本代码,不用get方式传值,而改用路由系统传值,增加seo: 阅读全文

爬虫替换ip

2017-06-14 17:15 by hl_流星, 608 阅读, 收藏,
摘要: import urllib.requestimport randomip=["122.72.56.112:8080","118.144.67.50:8118"]url1 = "http://www.whatismyip.com.tw"proxy_support = urllib.request.Pr 阅读全文

SQLAchemy

2017-06-13 15:07 by hl_流星, 262 阅读, 收藏,
摘要: >增 >删 >改 >查 >其他 阅读全文

pymysql的基本应用

2017-06-09 16:20 by hl_流星, 192 阅读, 收藏,
摘要: import pymysql# 增加,删,该# conn = pymysql.connect(host="localhost",user='root',password='',database="db666")# cursor = conn.cursor()# sql = "insert into 阅读全文

mysql基础补充(事务,游标等)

2017-06-07 18:34 by hl_流星, 144 阅读, 收藏,
摘要: 查看emp表: 1, mysql> desc emp; 但是不够详细 2,show create table emp\G: “\G”选项的含义是使得记录能够按照字段竖着排列,对于内 容比较长的记录更易于显示。 3,更新表: UPDATE score set num=1 WHERE sid=1; 应用 阅读全文

mysql中select+where in的一个常见错误

2017-06-07 17:31 by hl_流星, 4294 阅读, 收藏,
摘要: MySQL中You can't specify target table <tbl> for update in FROM clause错误的意思是说,不能先select出同一表中的某些值,再update这个表(在同一语句中)。 例如下面这个sql: delete from tbl where id 阅读全文

mysql 联表操作

2017-06-07 16:03 by hl_流星, 262 阅读, 收藏,
摘要: select * from userinfo5,department5 select * from userinfo5,department5 where userinfo5.part_id = department5.id select * from userinfo5 left join dep 阅读全文

mysql基础

2017-06-07 10:19 by hl_流星, 194 阅读, 收藏,
摘要: - SQL语句 - 数据库 create database db1; ? drop database db1; - 数据表 先创建tb2部门表 create table tb1用户表( id int not null auto_increment primary key, name char(10) 阅读全文

mysql练习题

2017-06-06 20:28 by hl_流星, 305 阅读, 收藏,
摘要: 1、自行创建测试数据 2、查询“生物”课程比“物理”课程成绩高的所有学生的学号; SELECT a.sid,a.student_id,a.cname,a.num,b.cname,b.num FROM (SELECT * FROM score LEFT JOIN course ON course.ci 阅读全文

关于mysqle删除的总结

2017-06-05 19:44 by hl_流星, 298 阅读, 收藏,
摘要: 如果要清空表中的所有记录,可以使用下面的两种方法: DELETE FROM table1 TRUNCATE TABLE table1 如果要删除部分: delete from 表 where id=1 and name='alex' 删除后自增项还默认保留,如果要将自增项索引和前面连接起来.如下操作 阅读全文

css学习一

2017-06-02 16:59 by hl_流星, 200 阅读, 收藏,
摘要: 一.window.onload和$(document).ready()的区别 1.window.onload需要加载完所有页面后执行,$(document).ready()结构绘制完毕就执行,可能元素关联的东西没有加载完 2.window.onload只能用一次,$(document).ready( 阅读全文