Git Product home page Git Product logo

flaskcode's Introduction

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.

flaskcode's People

Contributors

sujeetkv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

flaskcode's Issues

File Type not allowed

Hi,

Why get this on production env | behind nginx proxy with basic config :

image

Issue :
image

On Pycharm Dev env works fine.

Update to latest Monaco Editor Version

Realised this project was last updated in 2021 and there was an update for the editor just 4 days ago. The current version is a bit outdated in comparison to the latest version (2021 --> 2022).

Jinja2 support

Is it possible to add support for Jinja2 as a Language or provide basic text editor support so that atleast the file will open as text with no highlighting.

yaml support

This is a really nice tool. When you get time could you add the ability to edit .yaml or .yml files. My work around for now is to link the files as .txt. It understands yaml just fine just won't open them.

Thank you.
Brent

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.