Найти - Пользователи
Полная версия: python cherry.py
Начало » Web » python cherry.py
1
azecm
Подскажите как правильно запустить сервер СherryPy

сделал так создал файл по примеру 1

#!/usr/local/bin/python
# -*- coding: UTF-8 -*-

import cherrypy
import time

class HelloWorld:

def index(self):
t = time.time()
return “Hello world! %.7f” % (time.time()-t)

index.exposed = True


import os.path
tutconf = os.path.join(os.path.dirname(__file__), ‘tutorial.conf’)

if __name__ == ‘__main__’:
# CherryPy always starts with app.root when trying to map request URIs
# to objects, so we need to mount a request handler root. A request
# to ‘/’ will be mapped to HelloWorld().index().
cherrypy.quickstart(HelloWorld(), config=tutconf)
else:
# This branch is for the test suite; you can ignore it.
cherrypy.tree.mount(HelloWorld(), config=tutconf)

и запустил его в терминале командой python cherry.py
когда терминал закрываю сервер перестает работать
- Как его запустить независимо от терминала?
- Куда он пишет логи??
- Как делать рестарт?
Viper
ОС?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB