简体   繁体   中英

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. Then I use python command like this.

$ python server.py

But AttributeError has occurred.

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.

#!/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)

should be written as

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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