Skip to main content

Microservice for django

Project description

Django for microservice


    'ENGINE': '',
    'HOST': 'localhost',
    'TOPIC': 'topic'

Service 1

register tasks in apps/{appname}/

from msvc_framework import tasks
from msvc_framework import SUCCESS

def get_users(data):
    return {
        'status': SUCCESS,
        'data': [....]

run command

python subscribe

Service 2

sync call tasks

from msvc_framework import call

call('user.user.get', {'ids': [1]})

use in model

from msvc_framework import call

class Profile(models.Model):
    user = RemoteRelatedField('user.user.get')

    def __str__(self):

profile = Profile.objects.get(user=1)

use in Serializer

from msvc_framework import ModelSerializer

class ProfileSerializer(ModelSerializer):
    class Meta:
        model = Merchant
        fields = ('id', 'user', )


Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

How to deploy

Create config file in home directory ~/.pypirc

repository = 
username = myrubapa

After run command for build and deploy

python3 sdist bdist_wheel
python3 -m twine upload dist/*

for more detail read packaging-projects



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.

Files for msvc-framework, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size msvc_framework-0.0.1-py3-none-any.whl (8.3 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size msvc_framework-0.0.1.tar.gz (4.7 kB) File type Source Python version None Upload date Hashes View hashes

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 DigiCert DigiCert EV certificate StatusPage StatusPage Status page