简体   繁体   English

如何在ubuntu16.04上使用python部署Tonardo Web服务器?

[英]How to deploy Tonardo web server with python on ubuntu16.04?

I've built server.py which is responsible for launching server and send the data from csv file to browser with python Tornado web server. 我已经建立了server.py,它负责启动服务器,并使用python Tornado Web服务器将csv文件中的数据发送到浏览器。 Then I use python command like this. 然后我像这样使用python命令。

$ python server.py

But AttributeError has occurred. 但是发生了AttributeError。

Traceback (most recent call last):
  File "server.py", line 197, in <module>
    app.autoload.listen(80)
AttributeError: 'Application' object has no attribute 'autoload'*

The server.py is as follows. server.py如下。

#!/usr/bin/python 
# -*- coding: UTF-8 -*-# enable debugging 
from tornado.ioloop import IOLoop, PeriodicCallback
import tornado.ioloop
import tornado.web
import tornado.websocket
import json
import os
import csv
import sqlite3
..................
args={}
settings = {
    "static_path": os.path.join(os.path.dirname(__file__), "static"),
}
app = tornado.web.Application([
    (r'/cols', ColsHandler),
    (r'/', UploadHandler),
    (r'/conn', ConnHandler)],
    debug=True, **settings)
app.autoload.listen(80)
IOLoop.instance().start()

I don't understand what's going on here. 我不明白这里发生了什么。 I would like someone to tell me why this exception is appeared. 我想告诉我为什么会出现此异常。

The line app.autoload.listen(80) 该行app.autoload.listen(80)

should be written as 应该写成

app.listen(8080)  // or any other port that is not being used

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM