diff --git a/Library/BookLibrary/urls.py b/Library/BookLibrary/urls.py index de6715f..42def09 100644 --- a/Library/BookLibrary/urls.py +++ b/Library/BookLibrary/urls.py @@ -41,5 +41,7 @@ url('^ajaxlogin/$', views.ajaxlogin, name="ajaxlogin"), url('^checkuser/$', views.checkuser, name="checkuser"), url('^verifycode/$', views.verifycode, name="verifycode"), + + url('^echarts/$', views.echarts, name="echarts"), ] diff --git a/Library/BookLibrary/views.py b/Library/BookLibrary/views.py index 3b0ed29..232d455 100644 --- a/Library/BookLibrary/views.py +++ b/Library/BookLibrary/views.py @@ -10,9 +10,11 @@ from itsdangerous import TimedJSONWebSignatureSerializer as Serializer, SignatureExpired -# Create your views here. +from django.views.decorators.cache import cache_page +# Create your views here. +@cache_page(60*15) def index(request): # return HttpResponse("你好,世界!") messinfo = MessInfo.objects.all() @@ -370,3 +372,7 @@ def verifycode(request): # 将内存中的图片数据返回给客户端,MIME类型为图片png return HttpResponse(f.getvalue(), 'image/png') + +def echarts(request): + return render(request, 'BookLibrary/echarts.html') + diff --git a/Library/Library/settings.py b/Library/Library/settings.py index d2a6af4..c609e6a 100644 --- a/Library/Library/settings.py +++ b/Library/Library/settings.py @@ -146,6 +146,14 @@ EMAIL_HOST_PASSWORD = 'qikuedu' DEFAULT_FROM_EMAIL = 'zzy0371 <18137128152@163.com>' +# 缓存 +CACHES = { + "default": { + "BACKEND": "redis_cache.cache.RedisCache", + "LOCATION": "localhost:6379", + 'TIMEOUT': 60, + }, +} diff --git a/Library/db.sqlite3 b/Library/db.sqlite3 index 5f4dd35..06cdf7e 100644 Binary files a/Library/db.sqlite3 and b/Library/db.sqlite3 differ diff --git a/Library/list.txt b/Library/list.txt new file mode 100644 index 0000000..9b6614b --- /dev/null +++ b/Library/list.txt @@ -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 diff --git a/Library/templates/BookLibrary/ajaxlogin.html b/Library/templates/BookLibrary/ajaxlogin.html index 986c1bf..e1aa9e5 100644 --- a/Library/templates/BookLibrary/ajaxlogin.html +++ b/Library/templates/BookLibrary/ajaxlogin.html @@ -15,6 +15,7 @@ }, success: function (data) { console.log("+++") + console.log(data) $('#userinfo').text(data); } }) diff --git a/Library/templates/BookLibrary/echarts.html b/Library/templates/BookLibrary/echarts.html new file mode 100644 index 0000000..e46b5eb --- /dev/null +++ b/Library/templates/BookLibrary/echarts.html @@ -0,0 +1,141 @@ + + +
+ +