CherryPy REST webservice framework with MongoDB ORM support
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.
- 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
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 Your First Project
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 testcmd Success: This is a test command
MoCherry Sample Dataset
MoCherry provides sample data from the version 1.0.9 onwards. This should help developers to play around with the framework immediately without writing any code. You can create sample data by using following management command.
$ python manage.py load_sample_data Database: mongodb://localhost:27017/mocherry_sample_app New Sample Data: 5e9abd4ab22cfec440086e60 New Sample Data: 5e9abd4ab22cfec440086e61 New Sample Data: 5e9abd4ab22cfec440086e62 New Sample Data: 5e9abd4ab22cfec440086e63 New Sample Data: 5e9abd4ab22cfec440086e64 New Sample Data: 5e9abd4ab22cfec440086e65 New Sample Data: 5e9abd4ab22cfec440086e66 New Sample Data: 5e9abd4ab22cfec440086e67 New Sample Data: 5e9abd4ab22cfec440086e68 New Sample Data: 5e9abd4ab22cfec440086e69 New Sample Data: 5e9abd4ab22cfec440086e6a New Sample Data: 5e9abd4ab22cfec440086e6b New Sample Data: 5e9abd4ab22cfec440086e6c New Sample Data: 5e9abd4ab22cfec440086e6d New Sample Data: 5e9abd4ab22cfec440086e6e
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size mocherry-1.2-py3-none-any.whl (12.1 kB)||File type Wheel||Python version py3||Upload date||Hashes View|