用于夹层rest api的远程cli和python客户端sdk。

mezzanine-client的Python项目详细描述


#夹层API客户端

[![从pypi下载](https://img.shields.io/pypi/v/mezzanine client.svg)](https://pypi.python.org/pypi/mezzanine client)
[![许可证](https://img.shields.io/pypi/l/mezzanine client.svg)(https://pypi.python.org/pypi/mezzanine client)
[![加入聊天](https://badges.gitter.im/gcushen/mezzanine api.svg)](https://gitter.im/gcushen/mezzanine-api?utm_source=badge&utm_medium=badge&utm_campaign=pr badge)

[mezzanine api]的远程cli和python客户端sdk(http://gcushen.github.io/mezzanine api/)。

它允许用户或服务使用python或命令行远程读取或写入[mezzanine cms](http://mezzanine.jupo.org/)。例如,你可以在笔记本电脑上用markdown写一篇文章,然后键入一个简单的命令,自动上传并在网站上创建一篇新的博客文章。



(用于开发)或远程(用于生产),因为我们需要一个api来连接。


一旦安装了夹层api,

1。登录到您的夹层CMS管理面板(例如[http://127.0.0.1:8000/admin/](http://127.0.0.1:8000/admin/))
2。在菜单中,单击*oauth*>;*applications*
3。创建具有以下详细信息的新应用程序:

app name:mezzanine python client
app id:id
app secret:secret
client type:confidential
grant type:code
redirect uri:https://httpbin.org/get

您可以定义上面的简单应用程序ID和密钥,否则使用自动生成的应用程序ID和密钥。

cli documentation

[cli documentation website](http://gcushen.github.io/mezzanine api/cli/)


以及OAuth应用程序机密。这些设置与夹层API实例的位置和OAuth凭据相对应,以便对其进行身份验证(如以上*先决条件*部分所述)。

```
$mezzanine cli config api url http://127.0.0.1:8000/api
$mezzanine cli config client id
$mezzanine cli config clientsecret
``

您还可以通过发出不带任何参数的“mezzanine cli config”命令来查看当前配置和可用选项。请注意,“refresh\u token”设置不应更改。



《入门入门


>一些示例:

```
` `
`;列出所有文章(最新的文章排在第一位)。
$mezzanine cli posts list

<
` `获取ID为2的文章。
$mezzanine cli posts get 2


`从一个标记文件中创建一篇文章。
$mezzanine cli cli cli 2




岗位创建\
--title='test post from api client'\
--content file=~/desktop/test.md\
--categories='test,有趣的是,'\
--markdown
```


只需向任何命令添加`--help`即可获得命令行上的帮助:

````
``一般帮助。
$mezzanine cli

`;查看创建帖子的可用选项。
$mezzanine cli posts create--help
````

如果要清除凭据并重置cli配置,您可以通过运行:


$mezzanine cli logout

“app_secret”)

*](https://github.com/gcushen/mezzanine-client-python/tree/master/examples)目录。

utm_source=badge&;utm_medium=badge&;utm_campaign=pr badge)或留言,我们会尽力联系您。

github上的[star]夹层客户端(https://github.com/gcushen/mezzanine-client-python/)显示您的支持和监视更新。

请提交[ticket]文件(https://github.com/gcushen/mezzanine-client-python/issues)或提交拉取请求在GitHub上查找错误或功能请求。

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

推荐PyPI第三方库


热门话题
SpringWeb中的java更新/通知其他用户   java Lambda性能测试   java Bukkit插件:空白符号   java在按下按钮后改变彩色正方形的大小   javajavac相当于“D”?   java序列化接口   属性无法从属性文件返回值   java我应该使用什么查询来使用Jsoup从html页面提取符号?   java Android Studio项目结构问题   JAVA方法和返回值/公共变量(基础)   java将NativeQuery映射到POJO   java如何在下面的程序中消除NumberFormatException?   在java中获取链表与数组中的对象   java Android Firebase将用户发送到聊天室