{"id":15102054,"url":"https://github.com/jesusenlanet/django-nameko-standalone","last_synced_at":"2025-09-27T00:30:46.988Z","repository":{"id":50081752,"uuid":"161909128","full_name":"jesusenlanet/django-nameko-standalone","owner":"jesusenlanet","description":"Use the django ORM into your nameko microservices","archived":true,"fork":false,"pushed_at":"2021-06-06T02:56:12.000Z","size":10463,"stargazers_count":11,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-09-21T06:05:06.941Z","etag":null,"topics":["django","nameko","orm","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/django-nameko-standalone/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jesusenlanet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-15T13:47:06.000Z","updated_at":"2024-01-12T08:28:14.000Z","dependencies_parsed_at":"2022-08-21T04:10:35.557Z","dependency_job_id":null,"html_url":"https://github.com/jesusenlanet/django-nameko-standalone","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jesusenlanet%2Fdjango-nameko-standalone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jesusenlanet%2Fdjango-nameko-standalone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jesusenlanet%2Fdjango-nameko-standalone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jesusenlanet%2Fdjango-nameko-standalone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jesusenlanet","download_url":"https://codeload.github.com/jesusenlanet/django-nameko-standalone/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219871827,"owners_count":16554457,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","nameko","orm","python"],"created_at":"2024-09-25T18:45:51.810Z","updated_at":"2025-09-27T00:30:46.620Z","avatar_url":"https://github.com/jesusenlanet.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# ⛔️ Discontinued ⛔️\n\n# DJANGO NAMEKO STANDALONE\n[![PyPI version](https://badge.fury.io/py/django-nameko-standalone.svg)](https://badge.fury.io/py/django-nameko-standalone) [![Build Status](https://travis-ci.com/jesusenlanet/django-nameko-standalone.svg?branch=master)](https://travis-ci.com/jesusenlanet/django-nameko-standalone)\n## Use django into your nameko services\n## Requirements\nDeveloped for Python3.6.\n\nHave dependecies of:\n\n* Django==3.0.7\n* nameko==2.12.0\n\n## Installation\n`pip install django-nameko-standalone`\n\n## Usage\nThis package setup the django framework to take advantage of the ORM features and some other django features.\n\n`DjangoModels` will load all your apps models into one single space where the models are exposed.\n\nIf you have your models into`app1.models` and `app2.models`, your app models will be exposed from one point at your election (i.e. `models` or whatever other variable you inject `DjangoModels`).\n\nYou need to specify the DJANGO_NAMEKO_STANDALONE_SETTINGS_MODULE or DJANGO_SETTINGS_MODULE environment variable, if not, a 'settings' file is used by default.\n\nInject the dependency into the nameko service with the DjangoModels dependency.\n\nSupposing you injected the DjangoModels dependency into the `models` variable, you can use from your procedures like `self.models.MyModel.objects.all()`.\n\n\n## Configuration\n### Django nameko standalone configuration\ndjango-nameko-standalone need the next settings variable to work:\n```python\n# MANDATORY\nDJANGO_NAMEKO_STANDALONE_APPS = (\"\u003cmy_django_app\u003e\",)\n\n# OPTIONAL\nDJANGO_NAMEKO_STANDALONE_SETTINGS_MODULE = 'my_settings'\n\n# OPTIONAL | DEFAULT\nDJANGO_SETTINGS_MODULE = \"my_settings\"\n```\nThis variable control the applications where to load models.\n\n\n### Django configuration\nTo configure the django ORM, just configure it as normally for Django.\n\nThe `INSTALLED_APPS` and `SECRET_KEY` settings needs to be defined to make Django work.\n\n```python\n# Minimum configuration required to work\n\nDJANGO_NAMEKO_STANDALONE_APPS = (\"\u003cmy_django_app\u003e\",)\nINSTALLED_APPS = (\"\u003cmi_django_app\u003e\",)\nSECRET_KEY = '\u003cyour_secret_key\u003e'\nDATABASES = {\n    'default': {\n        'ENGINE': 'django.db.backends.postgresql',\n        'NAME': '\u003cdatabase\u003e',\n        'USER': '\u003cuser\u003e',\n        'HOST': '\u003chost\u003e',\n        'PORT': 5432,\n    }\n}\n```\n\n## Testing\n### Run tests with setup.py\nYou need to have installed setuptools\n```bash\npip install setuptools\n```\n\nTo test the package run in a shell, it will run the tests using pytest with the interpreter used against the Django version available to install (\u003e=1.11,\u003c=2.2.2).\n```bash\npython3 setup.py test\n```\n\n### Run tests with tox\nYou need to have install tox\n```bash\npip install tox\n```\n\nOnce satisfied, simply run the tox command\n```bash\ntox\n```\nIt will run a bunch of tests using python3.6 and multiple django versions\n\n## Example\n### Example scafolding\n* my_nameko_service\n    * services.py\n    * settings.py\n    * requirements.txt\n    * app1\n        * \\_\\_init\\_\\_.py\n        * models.py\n    * app2\n        * \\_\\_init\\_\\_.py\n        * models.py\n    \n### Example usage\n```python\nfrom django_nameko_standalone import DjangoModels\nfrom nameko.rpc import rpc\n\n\nclass NamekoService:\n    name = \"nameko_service\"\n    models = DjangoModels()  # Inject the django model dependency\n\n    @rpc\n    def get_items(self, host):\n        items = self.models.Item.objects.all()\n        ...\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjesusenlanet%2Fdjango-nameko-standalone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjesusenlanet%2Fdjango-nameko-standalone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjesusenlanet%2Fdjango-nameko-standalone/lists"}