Name | django-shopify-sync JSON |
Version |
3.1.0
JSON |
| download |
home_page | None |
Summary | A package for synchronizing Django models with Shopify resources. |
upload_time | 2025-08-28 17:53:54 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.11 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Django Shopify Sync
This is a maintained fork of https://github.com/discolabs/django-shopify-sync
## Installation
1. `pip install django-shopify-sync`
2. Add `'shopify_sync',` to `INSTALLED_APPS`
3. Create a new `shopify_sync.Session` in Django admin or shell, enter your Shopify admin API token and site name.
Where to get these fields:
- **API Token**: In the Shopify admin, this is caleld "API Key Password".
- **Site name**: If your domain is http://my-site.myshopify.com your site name is my-site.
This package supports Python 3.X and Django>=4.2
## How to use
First we will get some of the products from Shopify
```py
from shopify_sync.models import Product, Session
session = Session.objects.first() # Assuming you have just one that you made previously
products = Product.objects.sync_all(session, query="For bar")
```
`sync_all` passes all kwargs to the `shopify_resource.find` so we can
then sync only the items that shopify returns from that search. Now we have all
of the `products` stored locally. Now to update from Django
```py
product = Product.objects.first()
product.title = "New Bar Foo"
product.save(push=True)
```
The `save` method on the objects also accepts the optional argument `push`
which will push the updated model that is locally to Shopify. Now if a product
was edited on shopify through some means other than this Django app, we will
not have the current updated model. For this we need to sync
```py
changed_product.sync()
```
The `changed_product` will get a local copy of the shopify_resource and then
do a `.reload()` on it so that we make a request to shopify. Then we sync
that back with our database.
## How to publish a new version
Use [commitizen](https://commitizen-tools.github.io/commitizen/commands/bump/) via the [bin/publish.sh](bin/publish.sh) script.
```sh
./bin/publish.sh
```
## Contributing
This project is in maintenance mode. Please do not post feature requests unless you intend to both implement them in a merge request and generally help maintain the project. A great first step would be a merge request to update base packages and ensure we are compatible with new Django versions.
Raw data
{
"_id": null,
"home_page": null,
"name": "django-shopify-sync",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "thelab <thelabdev@thelab.co>",
"download_url": "https://files.pythonhosted.org/packages/eb/14/196a7fe72fb27bc54f8322ee335cdf2df4a1ec3487ffbdde3adda17a7b5a/django_shopify_sync-3.1.0.tar.gz",
"platform": null,
"description": "# Django Shopify Sync\n\nThis is a maintained fork of https://github.com/discolabs/django-shopify-sync\n\n## Installation\n\n1. `pip install django-shopify-sync`\n2. Add `'shopify_sync',` to `INSTALLED_APPS`\n3. Create a new `shopify_sync.Session` in Django admin or shell, enter your Shopify admin API token and site name.\n\nWhere to get these fields:\n\n- **API Token**: In the Shopify admin, this is caleld \"API Key Password\".\n- **Site name**: If your domain is http://my-site.myshopify.com your site name is my-site.\n\nThis package supports Python 3.X and Django>=4.2\n\n## How to use\n\nFirst we will get some of the products from Shopify\n\n```py\nfrom shopify_sync.models import Product, Session\nsession = Session.objects.first() # Assuming you have just one that you made previously\nproducts = Product.objects.sync_all(session, query=\"For bar\")\n```\n\n`sync_all` passes all kwargs to the `shopify_resource.find` so we can\nthen sync only the items that shopify returns from that search. Now we have all\nof the `products` stored locally. Now to update from Django\n\n```py\nproduct = Product.objects.first()\nproduct.title = \"New Bar Foo\"\nproduct.save(push=True)\n```\n\nThe `save` method on the objects also accepts the optional argument `push`\nwhich will push the updated model that is locally to Shopify. Now if a product\nwas edited on shopify through some means other than this Django app, we will\nnot have the current updated model. For this we need to sync\n\n```py\nchanged_product.sync()\n```\n\nThe `changed_product` will get a local copy of the shopify_resource and then\ndo a `.reload()` on it so that we make a request to shopify. Then we sync\nthat back with our database.\n\n## How to publish a new version\n\nUse [commitizen](https://commitizen-tools.github.io/commitizen/commands/bump/) via the [bin/publish.sh](bin/publish.sh) script.\n\n```sh\n./bin/publish.sh\n```\n\n## Contributing\n\nThis project is in maintenance mode. Please do not post feature requests unless you intend to both implement them in a merge request and generally help maintain the project. A great first step would be a merge request to update base packages and ensure we are compatible with new Django versions.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A package for synchronizing Django models with Shopify resources.",
"version": "3.1.0",
"project_urls": {
"Homepage": "https://gitlab.com/thelabnyc/django-shopify-sync",
"Repository": "https://gitlab.com/thelabnyc/django-shopify-sync"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "59ce8f40d385fcf2fa9beeb3f4a9eca06f3c4047e1087d428b62a6a97c393a98",
"md5": "4d27821f3480c9fdbdd0d100e82cba90",
"sha256": "4094772298d1e40bc5907a776582ddb1eab78641f3817253cc4948bb116dc378"
},
"downloads": -1,
"filename": "django_shopify_sync-3.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4d27821f3480c9fdbdd0d100e82cba90",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 44419,
"upload_time": "2025-08-28T17:53:53",
"upload_time_iso_8601": "2025-08-28T17:53:53.045937Z",
"url": "https://files.pythonhosted.org/packages/59/ce/8f40d385fcf2fa9beeb3f4a9eca06f3c4047e1087d428b62a6a97c393a98/django_shopify_sync-3.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "eb14196a7fe72fb27bc54f8322ee335cdf2df4a1ec3487ffbdde3adda17a7b5a",
"md5": "1f5806dda287a7b0c08aa1b50d40be51",
"sha256": "82b022f5e886ff523efe5c8e8b20163e6968c93a472b243b48dff7e1b67e1a88"
},
"downloads": -1,
"filename": "django_shopify_sync-3.1.0.tar.gz",
"has_sig": false,
"md5_digest": "1f5806dda287a7b0c08aa1b50d40be51",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 58959,
"upload_time": "2025-08-28T17:53:54",
"upload_time_iso_8601": "2025-08-28T17:53:54.913076Z",
"url": "https://files.pythonhosted.org/packages/eb/14/196a7fe72fb27bc54f8322ee335cdf2df4a1ec3487ffbdde3adda17a7b5a/django_shopify_sync-3.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-28 17:53:54",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "thelabnyc",
"gitlab_project": "django-shopify-sync",
"lcname": "django-shopify-sync"
}