Skip to main content

CherryPy REST webservice framework with MongoDB ORM support

Project description

MoCherry

MoCherry is built around CherryPy & mongoengine to support REST webserivces with very low memory footprint, support for MongoDB ORM, built-in production ready WSGI server and faster initilization.

Features

  • In-built REST webservice support
  • MongoDB ORM support with MongoEngine plugin
  • Similar usability & file system structure like Django to reduce the learning curve
  • Low memory footprint
  • In-built CherryPy WSGI server
  • Built-in basic encryption support
  • MIT licensed

Installation

MoCherry is already a part of python PyPi repository. So the following command will download and install MoCherry from PyPi repository and all it's required dependencies to your system or virtualenv.

$ pip install mocherry

Create First Application

Now MoCherry consists of a cli script which will enable developers to create a sample project / app from command-line without manually download it from github. Steps as follows:

Create project skeleton

$ mocherry-cli startproject "my_project_001"
Downloading sample project: https://github.com/techunits/mocherry/blob/master/mocherry/resources/samples/project.zip?raw=true
Creating new project: my_project_001
$ cd my_project_001
$ python manage.py runserver  # start WSGI server
[20/Jan/2020:00:52:20] ENGINE Listening for SIGTERM.
[20/Jan/2020:00:52:20] ENGINE Bus STARTING
[20/Jan/2020:00:52:20] ENGINE Set handler for console events.       
[20/Jan/2020:00:52:20] ENGINE Started monitor thread 'Autoreloader'.
[20/Jan/2020:00:52:21] ENGINE Serving on http://localhost:9090
[20/Jan/2020:00:52:21] ENGINE Bus STARTED

Create application skeleton

Lets assume you have already created a project by following above steps, then you have to go inside that project and create app skeleton as per your requirements.

# Application name: app_001
$ mocherry-cli startapp "app_001"
Downloading sample app: https://github.com/techunits/mocherry/blob/master/mocherry/resources/samples/app.zip?raw=true
Creating new app: app_001

# Application name: app_002
$ mocherry-cli startapp "app_002"
Downloading sample app: https://github.com/techunits/mocherry/blob/master/mocherry/resources/samples/app.zip?raw=true
Creating new app: app_002

$ python manage.py runserver  # start WSGI server
[20/Jan/2020:00:52:20] ENGINE Listening for SIGTERM.
[20/Jan/2020:00:52:20] ENGINE Bus STARTING
[20/Jan/2020:00:52:20] ENGINE Set handler for console events.       
[20/Jan/2020:00:52:20] ENGINE Started monitor thread 'Autoreloader'.
[20/Jan/2020:00:52:21] ENGINE Serving on http://localhost:9090
[20/Jan/2020:00:52:21] ENGINE Bus STARTED

MoCherry Management Commands

MoCherry framework also support custom management commands to enhance its CLI capabilities. With the framework sample code we have provided a test command to verify how it works

$ python manage.py test
Success: This is a test command

Sample Applications

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

mocherry-1.0.7-py3-none-any.whl (12.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page