Commit ab6a900 1 parent 194ebdf commit ab6a900 Copy full SHA for ab6a900
File tree 3 files changed +86
-6
lines changed
3 files changed +86
-6
lines changed Original file line number Diff line number Diff line change 2
2
from django .shortcuts import render_to_response
3
3
from django .http import HttpResponse
4
4
# from django.views.generic import ListView
5
- from django .conf import settings
5
+ # from django.conf import settings
6
6
from TM .models import Temperature
7
7
# import logging
8
8
from django .views .decorators .csrf import csrf_exempt
9
9
import sqlite3
10
10
# 查看tables:apt安装sqlite3,然后sqlite3 db.sqlite3,输入.tables。
11
- import matplotlib
12
- matplotlib .use ('Agg' )
13
11
import matplotlib .pyplot as plt
14
- import os
12
+ # import os
15
13
import TM .gl as gl
16
14
from channels import Group
15
+ # matplotlib.use('Agg')
16
+ # import matplotlib
17
17
18
18
# logger = logging.getLogger(__name__)
19
19
@@ -43,14 +43,15 @@ def index_plot(request):
43
43
cur = conn .cursor ()
44
44
cur .execute ("SELECT * FROM TM_Temperature" )
45
45
data = cur .fetchall ()
46
- data_0 = [int (row [0 ]) for row in data ][- 100 :]
47
- data_2 = [float (row [2 ]) for row in data ][- 100 :]
46
+ data_0 = [int (row [0 ]) for row in data ][- 500 :]
47
+ data_2 = [float (row [2 ]) for row in data ][- 500 :]
48
48
49
49
plot_file = 'static/TM/plot.png'
50
50
fig1 , ax1 = plt .subplots (figsize = (8 , 4 ), dpi = 98 )
51
51
ax1 .set_title (u'房间温度' , fontproperties = 'KaiTi' )
52
52
ax1 .set_xlabel (u'时间(小时)' , fontproperties = 'KaiTi' )
53
53
ax1 .set_ylabel (u'温度(\u2103 )' , fontproperties = 'KaiTi' )
54
+ plt .ylim (- 30 , 30 )
54
55
ax1 .plot (
55
56
data_0 ,
56
57
data_2 , )
Original file line number Diff line number Diff line change 139
139
STATIC_ROOT = os .path .join (BASE_DIR , 'static' )
140
140
141
141
WEBSITE_TITLE = u'Swint\' s blog'
142
+
143
+ TIME_ZONE = 'Asia/Shanghai'
Original file line number Diff line number Diff line change
1
+ asgi-redis == 1.4.3
2
+ asgiref == 1.1.2
3
+ attrs == 17.3.0
4
+ autobahn == 17.10.1
5
+ Automat == 0.6.0
6
+ autopep8 == 1.3.2
7
+ bleach == 2.0.0
8
+ channels == 1.1.8
9
+ constantly == 15.1.0
10
+ cycler == 0.10.0
11
+ daphne == 1.3.0
12
+ decorator == 4.0.11
13
+ Django == 1.11.2
14
+ entrypoints == 0.2.3
15
+ flake8 == 3.3.0
16
+ gunicorn == 19.7.1
17
+ html5lib == 0.999999999
18
+ hyperlink == 17.3.1
19
+ importmagic == 0.1.7
20
+ incremental == 17.5.0
21
+ ipykernel == 4.6.1
22
+ ipython == 6.1.0
23
+ ipython-genutils == 0.2.0
24
+ ipywidgets == 6.0.0
25
+ jedi == 0.10.2
26
+ Jinja2 == 2.9.6
27
+ jsonschema == 2.6.0
28
+ jupyter == 1.0.0
29
+ jupyter-client == 5.0.1
30
+ jupyter-console == 5.1.0
31
+ jupyter-core == 4.3.0
32
+ MarkupSafe == 1.0
33
+ matplotlib == 2.0.2
34
+ mccabe == 0.6.1
35
+ mistune == 0.7.4
36
+ msgpack-python == 0.4.8
37
+ nbconvert == 5.2.1
38
+ nbformat == 4.3.0
39
+ notebook == 5.0.0
40
+ numpy == 1.13.0
41
+ olefile == 0.44
42
+ pandas == 0.20.2
43
+ pandocfilters == 1.4.1
44
+ pbr == 3.1.0
45
+ pexpect == 4.2.1
46
+ pickleshare == 0.7.4
47
+ Pillow == 4.2.0
48
+ prompt-toolkit == 1.0.14
49
+ ptyprocess == 0.5.1
50
+ pycodestyle == 2.3.1
51
+ pyflakes == 1.5.0
52
+ Pygments == 2.2.0
53
+ pyparsing == 2.2.0
54
+ python-dateutil == 2.6.0
55
+ pytz == 2017.2
56
+ pyzmq == 16.0.2
57
+ qtconsole == 4.3.0
58
+ redis == 2.10.6
59
+ scipy == 0.19.0
60
+ simplegeneric == 0.8.1
61
+ six == 1.10.0
62
+ stevedore == 1.23.0
63
+ terminado == 0.6
64
+ testpath == 0.3.1
65
+ tornado == 4.5.1
66
+ traitlets == 4.3.2
67
+ Twisted == 17.9.0
68
+ txaio == 2.8.2
69
+ virtualenv == 15.1.0
70
+ virtualenv-clone == 0.2.6
71
+ virtualenvwrapper == 4.7.2
72
+ wcwidth == 0.1.7
73
+ webencodings == 0.5.1
74
+ widgetsnbextension == 2.0.0
75
+ xlrd == 1.0.0
76
+ yapf == 0.16.2
77
+ zope.interface == 4.4.3
You can’t perform that action at this time.
0 commit comments