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

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Selenium运行ChromeDriver而不修改路径   java软件包sun。网www.protocol。https不可见   java AEM中的哪个类实现了javax。servlet。请求调度器接口?   在java/scala中读取zip或7z文件时的性能问题   java将一个文件写入另一个二进制文件   java在类本身中创建实例   Java中C#Action()委托的等价物?   java如何在任何类中使用@Context或类似工具获取ServletRequest?   重构(java)应该/如何重构此代码?   hibernate中的java TransientObject异常   gwt使用Java在CouchDB 2.0 fauxton中创建文档   xml错误Java Jersey:NotAuthorizedException:HTTP 401未经授权   java heroku错误:无法找到或加载主类   java从CAS 5.0检索已发布的属性。Spring Security中的x 3.2.5