Skip to content

Commit ab6a900

Browse files
committed
Added requirements.txt.
1 parent 194ebdf commit ab6a900

File tree

3 files changed

+86
-6
lines changed

3 files changed

+86
-6
lines changed

TM/views.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
from django.shortcuts import render_to_response
33
from django.http import HttpResponse
44
# from django.views.generic import ListView
5-
from django.conf import settings
5+
# from django.conf import settings
66
from TM.models import Temperature
77
# import logging
88
from django.views.decorators.csrf import csrf_exempt
99
import sqlite3
1010
# 查看tables:apt安装sqlite3,然后sqlite3 db.sqlite3,输入.tables。
11-
import matplotlib
12-
matplotlib.use('Agg')
1311
import matplotlib.pyplot as plt
14-
import os
12+
# import os
1513
import TM.gl as gl
1614
from channels import Group
15+
# matplotlib.use('Agg')
16+
# import matplotlib
1717

1818
# logger = logging.getLogger(__name__)
1919

@@ -43,14 +43,15 @@ def index_plot(request):
4343
cur = conn.cursor()
4444
cur.execute("SELECT * FROM TM_Temperature")
4545
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:]
4848

4949
plot_file = 'static/TM/plot.png'
5050
fig1, ax1 = plt.subplots(figsize=(8, 4), dpi=98)
5151
ax1.set_title(u'房间温度', fontproperties='KaiTi')
5252
ax1.set_xlabel(u'时间(小时)', fontproperties='KaiTi')
5353
ax1.set_ylabel(u'温度(\u2103)', fontproperties='KaiTi')
54+
plt.ylim(-30, 30)
5455
ax1.plot(
5556
data_0,
5657
data_2, )

TemperatureMonitor/settings.py

+2
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,5 @@
139139
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
140140

141141
WEBSITE_TITLE = u'Swint\'s blog'
142+
143+
TIME_ZONE = 'Asia/Shanghai'

requirements.txt

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
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

0 commit comments

Comments
 (0)