-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
# Conflicts: # demo02/db.sqlite3
- Loading branch information
Showing
416 changed files
with
67,054 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,6 +146,14 @@ | |
EMAIL_HOST_PASSWORD = 'qikuedu' | ||
DEFAULT_FROM_EMAIL = 'zzy0371 <[email protected]>' | ||
|
||
# 缓存 | ||
CACHES = { | ||
"default": { | ||
"BACKEND": "redis_cache.cache.RedisCache", | ||
"LOCATION": "localhost:6379", | ||
'TIMEOUT': 60, | ||
}, | ||
} | ||
|
||
|
||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Click==7.0 | ||
Django==2.2 | ||
django-haystack==2.8.1 | ||
django-redis-cache==2.0.0 | ||
django-redis-sessions==0.6.1 | ||
django-tinymce==2.8.0 | ||
Flask==1.0.2 | ||
itsdangerous==1.1.0 | ||
jieba==0.39 | ||
Jinja2==2.10.1 | ||
Markdown==3.1 | ||
MarkupSafe==1.1.1 | ||
mysqlclient==1.4.2.post1 | ||
Pillow==6.0.0 | ||
PyMySQL==0.9.3 | ||
pytz==2019.1 | ||
redis==3.2.1 | ||
sqlparse==0.3.0 | ||
Werkzeug==0.15.2 | ||
Whoosh==2.7.4 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Ajax</title> | ||
|
||
<script src="/static/js/jquery-2.1.4.js"></script> | ||
<!--Load方法可以将服务器资源加载到制定元素--> | ||
<script> | ||
$(function () { | ||
$("#load").click(function () { | ||
$(".info").load("/static/css/style.css"); | ||
}) | ||
|
||
$("#ajax").click(function () { | ||
$.ajax({ | ||
url: '/booklibrary/ajaxs/', | ||
type: 'get', | ||
data: {'csrfmiddlewaretoken': $("input[name='csrfmiddlewaretoken']").val()}, | ||
success: function (data) { | ||
console.log(data) | ||
} | ||
}) | ||
}) | ||
|
||
}) | ||
</script> | ||
|
||
</head> | ||
<body> | ||
{% csrf_token %} | ||
<button id="load">点我load方法</button> | ||
<div class="info"></div> | ||
<button id="ajax">点我ajax方法</button> | ||
<div class="info2"></div> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{% extends 'BookLibrary/base.html' %} | ||
{% block title %}登录{% endblock %} | ||
{% block linkjs %} | ||
<script> | ||
|
||
$(function () { | ||
$('#username').blur(function () { | ||
// console.log("+++") | ||
$.ajax({ | ||
url: '/booklibrary/checkuser/', | ||
type: 'post', | ||
data: { | ||
"csrfmiddlewaretoken": $("input[name=csrfmiddlewaretoken]").val(), | ||
"username": $("#username").val() | ||
}, | ||
success: function (data) { | ||
console.log("+++") | ||
console.log(data) | ||
$('#userinfo').text(data); | ||
} | ||
}) | ||
}) | ||
$('#verifycode').click(function () { | ||
t = new Date() | ||
this.src = '/booklibrary/verifycode/?t='+t.getTime() | ||
}) | ||
}) | ||
|
||
</script> | ||
{% endblock %} | ||
|
||
{% block body %} | ||
|
||
<h2>登录</h2> | ||
<form action="{% url 'booklibrary:ajaxlogin' %}" method="post"> | ||
{% csrf_token %} | ||
用户: <input type="text" name="username" id="username"> <span id="userinfo"></span><br> | ||
密码: <input type="password" name="password" id="password"><br> | ||
验证码: <input type="text" name="verifycode"><img src="{% url 'booklibrary:verifycode' %}" alt="验证码加载失败" id="verifycode"><br> | ||
<input type="submit" value="登录"> | ||
|
||
</form> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>图表显示</title> | ||
<style> | ||
div{ | ||
float: left; | ||
} | ||
</style> | ||
<script src="https://echarts.baidu.com/examples/vendors/echarts/echarts.min.js"></script> | ||
</head> | ||
<body> | ||
|
||
<div id="main" style="width: 600px;height:400px;"></div> | ||
<div id="main2" style="width: 600px;height:400px;"></div> | ||
<div id="main3" style="width: 600px;height:400px;"></div> | ||
<script type="text/javascript"> | ||
// 基于准备好的dom,初始化echarts实例 | ||
var myChart1 = echarts.init(document.getElementById('main')); | ||
var myChart2 = echarts.init(document.getElementById('main2')); | ||
|
||
// 指定图表的配置项和数据 | ||
var option1 = { | ||
title: { | ||
text: 'ECharts 入门示例' | ||
}, | ||
tooltip: {}, | ||
legend: { | ||
data:['销量'] | ||
}, | ||
xAxis: { | ||
data: ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"] | ||
}, | ||
yAxis: {}, | ||
series: [{ | ||
name: '销量', | ||
type: 'bar', | ||
data: [5, 20, 36, 10, 10, 20] | ||
}] | ||
}; | ||
|
||
// 使用刚指定的配置项和数据显示图表。 | ||
myChart1.setOption(option1); | ||
|
||
|
||
|
||
|
||
var dataCount = 5e5; | ||
var data = generateData(dataCount); | ||
|
||
var option2 = { | ||
title: { | ||
text: echarts.format.addCommas(dataCount) + ' Data', | ||
left: 10 | ||
}, | ||
toolbox: { | ||
feature: { | ||
dataZoom: { | ||
yAxisIndex: false | ||
}, | ||
saveAsImage: { | ||
pixelRatio: 2 | ||
} | ||
} | ||
}, | ||
tooltip: { | ||
trigger: 'axis', | ||
axisPointer: { | ||
type: 'shadow' | ||
} | ||
}, | ||
grid: { | ||
bottom: 90 | ||
}, | ||
dataZoom: [{ | ||
type: 'inside' | ||
}, { | ||
type: 'slider' | ||
}], | ||
xAxis: { | ||
data: data.categoryData, | ||
silent: false, | ||
splitLine: { | ||
show: false | ||
}, | ||
splitArea: { | ||
show: false | ||
} | ||
}, | ||
yAxis: { | ||
splitArea: { | ||
show: false | ||
} | ||
}, | ||
series: [{ | ||
type: 'bar', | ||
data: data.valueData, | ||
// Set `large` for large data amount | ||
large: true | ||
}] | ||
}; | ||
|
||
function generateData(count) { | ||
var baseValue = Math.random() * 1000; | ||
var time = +new Date(2011, 0, 1); | ||
var smallBaseValue; | ||
|
||
function next(idx) { | ||
smallBaseValue = idx % 30 === 0 | ||
? Math.random() * 700 | ||
: (smallBaseValue + Math.random() * 500 - 250); | ||
baseValue += Math.random() * 20 - 10; | ||
return Math.max( | ||
0, | ||
Math.round(baseValue + smallBaseValue) + 3000 | ||
); | ||
} | ||
|
||
var categoryData = []; | ||
var valueData = []; | ||
|
||
for (var i = 0; i < count; i++) { | ||
categoryData.push(echarts.format.formatTime('yyyy-MM-dd\nhh:mm:ss', time)); | ||
valueData.push(next(i).toFixed(2)); | ||
time += 1000; | ||
} | ||
|
||
return { | ||
categoryData: categoryData, | ||
valueData: valueData | ||
}; | ||
} | ||
myChart2.setOption(option2); | ||
</script> | ||
|
||
|
||
|
||
|
||
</body> | ||
</html> |
Oops, something went wrong.