Skip to content
aurelianeLucas edited this page Sep 27, 2017 · 2 revisions

MVC web app with Python and Bottle

This template is used by Telosys to generate a Python MVC web app.

The generated code is organized as follows :

  • A set of methods defining a "REST resource" for each entity of the model
  • A global set of methods "common_resource.py"
  • A launcher "app.py"

Requirements :

  • Python persistence template
  • Python 3.x
  • Bottle 0.12 ( must be installed with 'pip' )

Getting started

1. Follow the steps to get started with Python persistence

You can find persistence template here

2. Generate your code with the current bundle

  • Define the variables REST_URL_ROOT and REST_API_ROOT in telosys-tools.cfg

    for example : REST_URL_ROOT=http://localhost:3000, REST_API_ROOT=/api/v1

  • Download the bundle containing the templates

  • Generate the code with Telosys

3. Install Bottle

Commands are the same with Windows, MAC OS and Linux

  • pip install bottle

4. Run the generated application

To launch the backed server use the following command :
$ python app.py

That's it !