xost是一个小型的嵌入式服务器,它简化了django应用程序的托管
xost的Python项目详细描述
xost是一个小型的嵌入式服务器,它简化了django应用程序的托管。
要求
扭曲
用法
- 安装应用程序:
- pip安装xost
将xost添加到已安装的应用程序:
INSTALLED_APPS = ( ...., ‘xost’ )
xost是通过settings.py中的xost键配置的:
XOST= { ‘key’: ‘value’ }
下面列出了可能的配置键(默认值在=sign之后提供):
address: None - string configuration listen addresses port = 8080 - a port number on which to listen min_threads = 5 - minimum number of threads in the pool max_threads = 20 - maximum number of threads in the pool root = ‘launch_folder’ - path to working (root) folder static_root = ‘launch_folder/static/’ - path to static file folder media_root = ‘launch_folder/media/ - path to media file folder log_path = ‘launch_folder/log/’ -path to log folder collect_static = True - do not collect static files to static root folder before launch debug = False - if set to true, prints debug information
启动:
python manage.py serve
默认情况下,服务器在端口8080上启动
要获取配置键的完整列表,请运行
python manage.py serve --help