django-microframework
Django microframework allows you for easy synchronization of database entities between multiple django instances.
Requirements
- Python (3.6, 3.7, 3.8)
- Django (1.11, 2.0, 2.1, 2.2)
Installation
pip install django-microframework
python manage.py migrate
Usage
Sender
In your models.py file:
from microframework.sender import connect_signals
connect_signals([RegularModel, JSONModel, TreeModel, ForeignKeyModel], 'example_sender')
In your settings.py:
MICROFRAMEWORK_AMQP_URI = 'pyamqp://guest:guest@172.17.0.5'
Listener
Create service.py file:
from microframework.handler import DjangoObjectHandler, NamekoHandlerMeta
from example.models import RegularModel, JSONModel, TreeModel, ForeignKeyModel
class ListenerService(DjangoObjectHandler, metaclass=NamekoHandlerMeta):
name = "listener_service"
sender_name = "example_sender"
synced_save_models = [RegularModel, JSONModel, TreeModel, ForeignKeyModel]
In your settings.py:
MICROFRAMEWORK_SERVICE_CLASS = "example.service:ListenerService"
MICROFRAMEWORK_AMQP_URI = 'pyamqp://guest:guest@172.17.0.5'
And add 'microframework' to your INSTALLED_APPS setting.
INSTALLED_APPS = [
...
'microframework',
]
In your manage.py - this needs to be put before anything else in your code:
import eventlet
eventlet.monkey_patch()
Metadata
Release files for django-microframework 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-microframework-0.1.0.tar.gz | 5.0 kB | Without provenance | Details for django-microframework-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_microframework-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for django_microframework-0.1.0-py3-none-any.whl |
Total release size: 13.1 kB
Release files / django-microframework-0.1.0.tar.gz
| Download URL | django-microframework-0.1.0.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9bc757b9ddc91a0d96b0b8a63f86a7754cf77091ab5d7649c589bf0ee0fc107d
|
|
BLAKE2b-256 checksum How to use checksums |
464f84b2dee04b163ac24975ebf13f24936903d73ebcd13a281ccf3f191a32a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.1
|
Release files / django_microframework-0.1.0-py3-none-any.whl
| Download URL | django_microframework-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
941f064a263df3bb6e6ed191ff74e0844112a0ddafb281c1442c3bca5861996a
|
|
BLAKE2b-256 checksum How to use checksums |
c1d354f589e30220079906d9f6339f68a9935f465e9b04c4fb2f8aff101a3125
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.1
|
Security for django-microframework 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.