Skip to main content

Mongoengine Pyramid extension based in flask-mongoengine

Project description

# Pyramid Mongoengine

pyramid-mongoengine package based in [flask-mongoengine](https://github.com/MongoEngine/flask-mongoengine)

## README In Progress

## Install

pip install pyramid-mongoengine

## Config

Basic setup
```python

if __name__ == "__main__":
config = Configurator()

config.include("pyramid_mongoengine")
config.add_connection_database()

```

`pyramid-mongoengine` provides `add_connection_database()`, he makes a connection with database
using data coming from .ini file.

```python

mongo_url = mongodb://my_ip_location_to_mongodb
mongodb_name = "my_db_application"

```

If theses data not exists in .ini, `pyramid-mongoengine` use default values

```python
# Default values
mongo_url = mongodb://localhost
mongodb_name = "test"
```

## Creating models

```python

from pyramid_mongoengine import MongoEngine

db = MongoEngine()

class User(db.Document):
email = db.StringField(required=True)
username = db.StringField(requred=True)

```

See [demo](https://github.com/marioidival/pyramid_mongoengine/blob/master/demos/app.py) application to examples

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

pyramid-mongoengine-0.0.4.tar.gz (4.8 kB view details)

Uploaded Source

File details

Details for the file pyramid-mongoengine-0.0.4.tar.gz.

File metadata

File hashes

Hashes for pyramid-mongoengine-0.0.4.tar.gz
Algorithm Hash digest
SHA256 bddf97642ccc5bad70f15e9d3b6118a7dea0cf964b5fae120d705fb4975e64a4
MD5 4a2e358d9d43b218b6d0ac6b8c474577
BLAKE2b-256 495df9e0556f61a2da72d27724f31ae029e96f74636d8988a6e47c6186e1c09d

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