1 Star 0 Fork 1

AwesomeApps / flask-monaco

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

flaskcode

Build Status PyPI Version MIT License

Web based code editor on python flask framework.

screenshot

Installation

pip install flaskcode

Run application from CLI

Run flaskcode standalone, using following command:

flaskcode /path/to/resource/folder

Get help for CLI command:

flaskcode --help
Usage: flaskcode [OPTIONS] [RESOURCE_BASEPATH]

  Run FlaskCode with given RESOURCE_BASEPATH or current working directory.

  All options can be set on the command line or through environment
  variables of the form FLASKCODE_*. For example FLASKCODE_USERNAME.

Options:
  -h, --host TEXT                 IP or hostname on which to run HTTP server.
  -p, --port INTEGER              Port on which to bind HTTP server.
  --username TEXT                 HTTP Basic Auth username.
  --password TEXT                 HTTP Basic Auth password.
  --editor-theme [vs|vs-dark|hc-black]
                                  Editor theme, default is vs-dark.
  --debug                         Run in flask DEBUG mode.
  --env TEXT                      Flask environment, default is development.
  --version                       Show the version and exit.
  --help                          Show this message and exit.

Integrating flaskcode in your Flask app

The flaskcode can be integrated in to your own Flask app by configuring and registering flaskcode.blueprint with your app:

from flask import Flask
import flaskcode

app = Flask(__name__)
app.config.from_object(flaskcode.default_config)
app.config['FLASKCODE_RESOURCE_BASEPATH'] = '/path/to/resource/folder'
app.register_blueprint(flaskcode.blueprint, url_prefix='/flaskcode')

@app.route('/')
def hello():
    return "Hello World!"

if __name__ == '__main__':
    app.run()

Now if you run the Flask app on default port, you can access the flaskcode at http://127.0.0.1:5000/flaskcode.

Built with

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License Copyright (c) 2019 Sujeet Kumar <sujeetkv90@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

通过Flask加载Monaco的WebEditor 展开 收起
Python 等 3 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Python
1
https://gitee.com/noctua/flask-monaco.git
git@gitee.com:noctua/flask-monaco.git
noctua
flask-monaco
flask-monaco
master

搜索帮助