- 博客(22)
- 收藏
- 关注
原创 MySql 中关键字 case when then else end 的用法
1.世界杯某次统计记录如下,请按照日期统计每日胜负 sf date 负 2017-04-10 00:00:00.000000 胜 2017-04-10 00:00:00 负 2017-04-9 00:00:00 负 2017-04-9 00:00:00 胜 2017-04-9 00:00:00 胜 2017-...
2018-07-18 13:53:12 878
原创 ubuntu系统django项目部署
安装包 sudo apt updateapt install mysql-server mysql-client设置远程访问mysql a) 查找 mysql.conf find / -name mysql.cnf b)注释mysql.cof文件的bind_address ——– vim /etc/mysql/mysql.conf.d/mysqld.cnf /etc/...
2018-07-17 23:51:48 200
原创 Docker
Docker 是一个为开发者和系统管理员在容器中开发、部署和运行的平台。灵活、轻量级、可互换、部署简单、扩展性强Docker的应用场景 Web 应用的自动化打包和发布。 自动化测试和持续集成、发布。镜像Image和容器Container• 容器是运行镜像后产生的 • 镜像是一个包含所有需要运行的文件组成的包,比如代码、可运行文件、库、环境变量和配置文件等。镜像是容...
2018-07-17 15:47:34 931
转载 The Hard Way Is Easier
This simple book is meant to get you started in programming. The title says it’s the hard way to learn to write code; but it’s actually not. It’s only the “hard” way because it’s the way people used t...
2018-07-14 15:12:09 191
原创 Python中for in range 用法
当要访问的链接后面前面一致,只有后面的数字改变的时候第一页:https://bj.77j.com/fang/n1第二页:https://bj.77j.com/fang/n2第三页:https://bj.77j.com/fang/3………..依次类推可以用以下方式:start_urls = ['https://bj.77j.com/fang/n' + str(x) f...
2018-07-14 09:40:38 7391
原创 Python if和for的多种写法
1.常规if a>b: c=aelse: c=b2.表达式c = a if a>b else b3.二维列表c = [b,a][a>b]
2018-07-14 09:34:19 519
原创 django图片可以成功上传,但页面不显示
解决办法:https://www.cnblogs.com/52forjie/p/7875875.htmlfrom django.views.static import serve #需要导入url(r'^media/(?P<path>.*)$', serve, {'document_root':settings.MEDIA_ROOT}), #这部分很重要...
2018-07-11 19:59:27 2197 2
原创 爬虫实现二级链接页面信息爬取
一.scrapy环境搭建,参考我的博客–>爬虫框架虚拟环境搭建二.scrapy设置配置1.设置用户代理进入页面并刷新,进入开发者模式,点击选中一个网页,在Network-Headers中找到USER_AGENT,并复制就可以了.USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537...
2018-07-11 19:52:17 12408 3
原创 爬虫实际应用(1)
1.运行爬虫脚本命令#编写爬虫脚本时,需要给脚本取一个名字scrapy crawl name2.进入调试界面#该命令会进入到https://movie.douban.com/top250网页的调试界面scrapy shell https://movie.douban.com/top250#该命令直接进入到脚脚本的调试界面python manage.py she...
2018-07-11 15:19:49 4574
原创 Python学习过程遇到的坑-项目(2)
1.用户登录代码已经注释# 用户登录def login(request): # get请求获取登录页面 if request.method == 'GET': return render(request, 'xym/login.html') # post请求获取信息 if request.method == 'POST': #th...
2018-07-10 17:23:12 751
原创 获取页面输入信息
后端代码:#获取area直接get就可以area_info = request.POST.get('areainfo')#获取图片信息用FILESpicture_info = request.FILES.get('pictureinfo')#facility是一个多选框,其信息是放在一个列表中,获取用户页面选项采用getlistfacility_info = request....
2018-07-10 17:12:41 952
原创 Python学习过程遇到的坑--项目(1)
1.HTML导入CSS和JS{% load static %}<!doctype html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>首页</title>
2018-07-10 17:09:59 188
原创 模板的继承
1.模板的继承举例有一个base.html模板如下:<p> 这是一个继承模板</p>{% block content %}{% endblock %}以下test.html的代码如下{% extends 'base.html' %} #引用上面的base.html模板{% block content %} <a h...
2018-07-10 00:13:29 3122
原创 django页面跳转问题
1.页面跳转项目的urls:urlpatterns = [ url(r'^app/', include(('app.urls'),namespace='my_app')),]app的urls:urlpatterns = [ #首页 url(r'^index/',views.my_home,name='my_index'),]如果登录成功...
2018-07-09 20:31:33 10340
原创 linux scp命令
Linux scp命令用于Linux之间复制文件和目录。scp [可选参数] file_source file-target1.从本地复制到远程命令格式:#scp loacl_file romote_username@romote_ip:remote_folderscp local_file remote_username@remote_ip:remote_fil...
2018-07-09 10:08:45 177 1
原创 Something about the project(1)
During these days,we begin to do a project in a team.Everyone has to finish their own part,what i do is to finish the part about add the house informations.i finish it in the second day,i dont know be...
2018-07-07 16:58:54 116
原创 Python学习过程遇到的坑(2)
1.HTML导入CSS和JS{% load static %}<!doctype html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>首页</title>
2018-07-07 16:20:29 403
原创 git使用教程(2)-----合并到分支
1.假设现在在yanmei分支,执行以下命令:git add .git commit -m 'yanmei'gitb push origin yanmei2.首先切换到master分支git checkout master3.把master分支代码pull下来git pull origin master4.将yanmei分支的代码合并到mas...
2018-07-07 16:06:11 160
原创 The solution to restart mongo
During these days,when i start the mongon ,It will sometime fail because another mongo is running on the server.Here is some solutions for the problems.i will try to make more details in the fut...
2018-07-05 09:18:09 123
原创 Ubuntu下MongoDB的安装以及配置&mongo常用命令
Ubuntu下MongoDB的安装以及配置 MongoDB是一个NoSQL数据库。它是使用C++编写的开源、跨平台,面向文档的数据库。1.在mongDB官网下载mongoDBwget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.6.5.tgz 2.解归档gunzip &lt;filenam...
2018-07-04 20:35:45 480
原创 CenterOS7下mongoDB安装以及配置
1.在mongDB官网下载mongoDBwget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.6.5.tgz 2.解归档gunzip mongodb-linux-x86_64-3.6.5.tgz3.解压缩tar -xvf mongodb-linux-x86_64-3.6.5.tar4...
2018-07-04 20:34:03 3178
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人