Skip to main content

Comring, the PTI ERP companion tool

Project description

Comring

Comring is a companion tool for Paragon ERP.

Installing

Install using pip

pip install comring

Odoo Environments Configuration

The system will read Odoo servers (environments) configuration from $HOME/.config/odoopti.yaml file:

environments:
    live:
        name: Odoo Live
        url: https://odoo.pti-cosmetics.com
        database: paragon
        kind: live
        user: toolbox
        password: secretpass

    local-testing:
        name: Local Testing
        url: http://localhost:8069
        database: test
        kind: live
        user: admin
        password: 1

    ...

Description for each environment configuration keys:

  1. name: Name or label
  2. url: Server url
  3. database: Database to be used
  4. kind: Implementation. Valid values are: live, spinoff, nbm
  5. user: The user to be used when communicating with the server
  6. password: Password for the user

Web App

Development Mode with Flask Built-in Server

Environment Variables

The web app uses flask as engine, these variables can be set to configure the app. You can refer to flask docs for a complete reference. This project also uses python-dotenv so you can create .env file to set env vars more easily. The three most important variables are:

FLASK_RUN_HOST=0.0.0.0
FLASK_RUN_PORT=5555
FLASK_ENV=development

Running with Self-Signed SSL certificate

To generate a self-signed SSL certificate:

openssl req -x509 -newkey rsa:4096 -nodes -out cert.pem -keyout key.pem -days 365

Add this to .env:

FLASK_RUN_CERT=cert.pem
FLASK_RUN_KEY=key.pem

Running Development Server

To run web app:

flask run

Production Mode with CherryPI's WSGI Server

python3 -m comring.webapp [-a bind_address] [-p bind_port]

Performance Testing

In this example we'll use apache-util's ab testing tool to stress test the web application.

Requirements

ab available from apache2-utils package

sudo apt-get install apache2-utils

Run application

Run in development mode or production mode. You may also test remotely deployed application.

Get a Sesssion Cookie

Open the application in browser, then login. We will reuse the cookie used by the browser in ab:

  1. Open developer tool
  2. In the 'Application' or 'Storage' menu, search for Cookies
  3. Copy the session cookie value

Run ab

To run 160 requests split into 80 concurrent users:

ab -n 160 -c 80 -C session=<cookie valued copied from browser> -p benchmark/post-invoice-small.data -T 'application/x-www-form-urlencoded' http://localhost:5500/invoice/by_brand

Alternative: siege

Create .siegerc file to set server address and login credentials:

SERVER_URL = http://localhost:5555
login-url = ${SERVER_URL}/auth/login POST environment=live&username=myuser&password=mypassword

Adjust url and parameters to suit your need, then run siege:

siege -f benchmark/siege-local-small.txt -b -c 80 -r 2

Read siege manual for more information on how to use it.

Project details


Download files

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

Source Distribution

comring-0.1.0.tar.gz (5.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

comring-0.1.0-py3-none-any.whl (6.2 MB view details)

Uploaded Python 3

File details

Details for the file comring-0.1.0.tar.gz.

File metadata

  • Download URL: comring-0.1.0.tar.gz
  • Upload date:
  • Size: 5.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7

File hashes

Hashes for comring-0.1.0.tar.gz
Algorithm Hash digest
SHA256 405d1a48f9a15bf08509c188167544e677597fb930efb91e695449cadbe50dd4
MD5 099d7366e0bce11dff6d3e232a504f88
BLAKE2b-256 f9cbcdd7547f57e28573fe1304e142161fe547ba241b9e2b2ce2129c770a8bc4

See more details on using hashes here.

File details

Details for the file comring-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: comring-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7

File hashes

Hashes for comring-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4038044485c684351bb83f0be9c18682337740d64dfde28994323a4cc5554ef2
MD5 3ca448fba8cca91515d5a222272e99f3
BLAKE2b-256 e5c250d997c7dc1a1ffe444a3f8419bb39b19275c31390188faf135c75f213d9

See more details on using hashes here.

Supported by

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