客户端机器中的Python eve api访问[重复]

问题描述 投票:0回答:1

这个问题在这里已有答案:

我想在客户机中访问python eve的其余api。这是我的代码,

MONGO_HOST = 'localhost'
MONGO_PORT = 27017
MONGO_USERNAME = ''
MONGO_PASSWORD = ''
MONGO_DBNAME = 'test'
RESOURCE_METHODS = ['GET', 'POST', 'DELETE']
cust = {
          'item_title': 'Custmer Detail',
          'cache_control': 'max-age=10,must-revalidate',
          'cache_expires': 10,
          'resource_methods': ['GET', 'POST'],
          'schema': {
                        "CUSTOMERID" : {    'type': 'string' },
                        "COMPANYNAME": {    'type': 'string' }
          }
       }
DOMAIN = {'Customers': cust}

我在本地计算机上获得输出但我想知道如何配置主机和端口以在客户端或其他计算机中访问此表。

python api eve
1个回答
1
投票

这个问题已经是asked and answered。引用那一个答案:

app.run()中添加一个参数。默认情况下,它在localhost上运行,将其更改为app.run(host= '0.0.0.0')以在您的计算机IP地址上运行。

© www.soinside.com 2019 - 2024. All rights reserved.