Skip to main content

asyncio REST API Resource database

Project description

https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat https://travis-ci.org/plone/guillotina.svg?branch=master Test Coverage Python Versions https://img.shields.io/pypi/v/guillotina.svg License Chat

Please read the detailed docs

This is the working project of the next generation Guillotina server based on asyncio.

Dependencies

  • python >= 3.6
  • postgresql >= 9.6

Quickstart

We use pip:

pip install guillotina

Run postgresql

If you don’t have a postgresql server to play with, you can run one easily with docker.

Download and start the docker container by running:

make run-postgres

Run the server

To run the server:

g

Then…

curl http://localhost:8080

Or, better yet, use postman to start playing with API.

You can also navigate in your Guillotina server with its built-in web admin interface by visiting http://localhost:8080/+admin/.

Getting started with development

Using pip:

./bin/pip install requirements.txt
./bin/pip install -e .[test]

Run tests

We’re using pytest:

./bin/pytest guillotina

and for test coverage:

./bin/pytest --cov=guillotina guillotina/

With file watcher…

./bin/ptw guillotina –runner=./bin/py.test

To run tests with cockroach db:

USE_COCKROACH=true ./bin/pytest guillotina

Default

Default root access can be done with AUTHORIZATION header : Basic root:root

Docker

You can also run Guillotina with Docker!

First, run postgresql:

docker run --rm \
    -e POSTGRES_DB=guillotina \
    -e POSTGRES_USER=guillotina \
    -p 127.0.0.1:5432:5432 \
    --name postgres \
    postgres:9.6

Then, run guillotina:

docker run --rm -it \
    --link=postgres -p 127.0.0.1:8080:8080 \
    guillotina/guillotina:latest \
    g -c '{"databases": [{"db": {"storage": "postgresql", "dsn": "postgres://guillotina:@postgres/guillotina"}}], "root_user": {"password": "root"}}'

This assumes you have a config.yaml in your current working directory

Chat

Join us to talk about Guillotina at https://gitter.im/plone/guillotina

4.4.9 (2019-01-15)

  • Handle if no data to iterate on for downloads [vangheem]

4.4.8 (2019-01-15)

  • Fix release [vangheem]

4.4.7 (2019-01-15)

  • Defer preparing download response so http exceptions are handle correctly [vangheem]

4.4.6 (2019-01-15)

  • Fix getting binding file field for cloud files [vangheem]
  • provide guillotina.utils.get_url function that pays attention to X-VirtualHost-Monster header [vangheem]
  • Take X-Forwarded-Proto into account for request url [vangheem]
  • Implement multi attachments [masipcat]

4.4.5 (2019-01-11)

  • Allow to login on IApplication. [bloodbare]

4.4.4 (2019-01-11)

  • Be able to prevent closing database connection pools [vangheem]

4.4.3 (2019-01-11)

  • Implement db.storage.spg.PGConnectionManager class to allow safely sharing pool and read connections between multiple storages. [vangheem]

4.4.2 (2019-01-10)

  • Option to add different type of containers. [bloodbare]

4.4.1 (2019-01-09)

  • Postgresql storage accepts pool arguments [vangheem]

4.4.0 (2018-12-27)

New:

  • Implement HEAD for @download endpoint [vangheem]
  • Be able to customize the table names used with objects_table_name and blobs_table_name database configuration options. [vangheem]
  • Adding the option to define the reader for annotations [bloodbare]

Fixes:

  • Fix Resource.__getattr__() for empty fields with default values [masipcat]

4.3.5 (2018-12-09)

  • Added before render view event [lferran]

4.3.4 (2018-12-06)

  • Check valid generated id [vangheem]
  • Implement delete by value for PatchField(value_type=schema.List()) [vangheem]

4.3.3 (2018-12-03)

  • Be able to override configuration with environment variables [vangheem]

4.3.2 (2018-11-20)

  • Fix MockTransaction test object to have manager property [vangheem]

4.3.1 (2018-11-15)

  • Missing utilities settings should not cause error [vangheem]

4.3.0 (2018-11-13)

  • Remove Container from available-types [bloodbare]

  • No automatic async util loaded. [bloodbare]

    BREAKING CHANGE: Async Utilities are not loaded by default so they need to be defined on the package configuration on the merging settings at __init__.py. Utilities are not key mapped, each utility has an id to reflect it. Now config.yaml files only need to define them if you want to overwrite.

  • Improve Documentation

    • Index page
    • Security page

    [hirokiky]

4.2.13 (2018-11-09)

  • Update admin interface:

    • Support for guillotina.cms
    • Edit form
    • Add medium-like richtext editor

    [ebrehault]

4.2.12 (2018-11-07)

  • Be able to specify ?include=* to include all behaviors in response [vangheem]

  • Be able to specify data_key and auto_serialize for behavior configuration [vangheem]

  • Fixing #374 were required fields were not checked [bloodbare]

  • Fix shell command with Python 3.7 [vangheem]

  • No longer use utils.clear_conn_statement_cache as asyncpg does not properly clean up prepared statements when using the clear method. See https://github.com/MagicStack/asyncpg/blob/v0.13.0/asyncpg/connection.py#L1499 The _maybe_gc_stmt is never called on the statement so they never get cleaned from the database. Due to this implementation, with databases under large enough load, it can cause postgresql to run out of memory. utils.clear_conn_statement_cache is now considered a dangerous API method, is marked deprecated, implementation is now emptied and will be removed in the next major version of Guillotina.

    As an alternative, use the connection option of statement_cache_size: 0 or a very low value for max_cached_statement_lifetime.

    This case is only noteworthy when running against very large postgresql databases. In certain cases, PG does a terrible job query planning and pegs CPU. [vangheem]

4.2.11 (2018-10-30)

You are seeing a truncated changelog.

You can read the changelog file for a complete list.

Project details


Release history Release notifications

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
guillotina-4.4.9-py3-none-any.whl (5.4 MB) Copy SHA256 hash SHA256 Wheel py3
guillotina-4.4.9.tar.gz (5.9 MB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page