J'utilise tornado pour créer un serveur Web. Maintenant que tout est prêt, je peux visiter mon site web avec l'adresse IP de mon serveur.
Comment définir le nom de domaine pour tornade
De plus, j'ai un nom de domaine mais je ne sais pas comment utiliser le nom de domaine pour visiter mon serveur. Par exemple, l'adresse IP est a.a.a.a
et le nom de domaine est www.mysite.com
. Pour l'instant je peux utiliser www.mysite.com
pour visiter mon site mais seulement la page d'index. Ce qui signifie que je ne peux pas visiter toutes les sous-pages, telles que www.mysite.com/page1.html
.
Voici mon code:
class Application(tornado.web.Application):
def __init__(self):
handlers = [
(r"/(.*js$)", tornado.web.StaticFileHandler, {'path': 'static/'}),
(r"/(.*css$)", tornado.web.StaticFileHandler, {'path': 'static/'}),
(r"/(.*xml$)", tornado.web.StaticFileHandler, {'path': 'static/'}),
(r"/(.*jpg$)", tornado.web.StaticFileHandler, {'path': 'static/'}),
(r"/(.*png$)", tornado.web.StaticFileHandler, {'path': 'static/'}),
(r"/(.*ico$)", tornado.web.StaticFileHandler, {'path': 'static/'}),
(r"/(.*country\.html$)", PageHandler),
(r"/(.*city\.html$)", PageHandler),
(r"/(.*look\.html$)", PageHandler),
(r"/(index)", SearchHandler),
(r"/$", IndexHandler),
]
settings = dict(
#template_path = os.path.join(os.path.dirname(__file__), "beejeen/"),
#static_path = os.path.join(os.path.dirname(__file__), "beejeen/"),
)
super(Application, self).__init__(handlers, **settings)
Je pense que je devrais faire une configuration pour la tornade, mais je ne sais pas comment.