These are chat archives for mirumee/saleor

16th
Jul 2018
duy.pham
@berong91
Jul 16 2018 03:32
Hey all, I wonder if anyone has this issue with S3 boto storage for static files? On mysite, whenever global envDEBUG=False, all statics file get 404 error. I'm on v2018.03. If I understand correctly, for production code I may need to change both MEDIA_URL and STATIC_URL to my domain URL, but I'm not sure it's the site domain or S3 domain.
Marcin Gębala
@maarcingebala
Jul 16 2018 06:59
@TheBlackDude There is no such built-in integration, but it's possible to build one. It all depends on the format you'll exchange the data (JSON via API, CSV files etc.) and when you would sync it. You need a script that communicates with the service, fetches data, processes it and saves into Saleor. If you want to synchronize periodically, you can write a custom Django command that runs your script and spawn it using Cron. If you need guidance on particular integration, we can provide some tips on how to design it.
Btw. in the future we'd like to have integration with some of the "big players" such as Shopify or Magento to easiliy exchange data and migrate to Saleor.
Ousmane Seidy Diallo
@TheBlackDude
Jul 16 2018 08:02
thanks @elwoodxblues that was the approach i was thinking of taking
I'll discus with my team if they agrees they once we finish implementing it we'll open source it as a plugin for this project
Marcin Gębala
@maarcingebala
Jul 16 2018 08:23
@berong91 Examine the URL for your static files that resulted in 404, you may then see what's wrong with it.
Shamhaad
@shamhaad180
Jul 16 2018 08:23
Anyone has experience with getting one product from grpahql? I am doing
{
product(id: 1) {
name
availableOn
category {
id
name
parent {
id
name
}
}
price {
amount
}
}
}
Marcin Gębala
@maarcingebala
Jul 16 2018 08:23
I.e. you would see how it actually looks and what you expected
Shamhaad
@shamhaad180
Jul 16 2018 08:24
But I get Could not resolve to a node with the global id of '1'."
Marcin Gębala
@maarcingebala
Jul 16 2018 08:24
@shamhaad180 GraphQL uses it's own IDs. Fetch a list of products first and for each product query the id field
Shamhaad
@shamhaad180
Jul 16 2018 08:24
Sorry the code looks awful up there.
Marcin Gębala
@maarcingebala
Jul 16 2018 08:25
this is the id you should use what fetching single products
Shamhaad
@shamhaad180
Jul 16 2018 08:25
Ah. So I can't directly call the id from the database.
Perhaps I can use another field?
Marcin Gębala
@maarcingebala
Jul 16 2018 08:25
For now only the Graphql id is supported
Shamhaad
@shamhaad180
Jul 16 2018 08:26
Oh I see. Great. Thank you.
Marcin Gębala
@maarcingebala
Jul 16 2018 08:26
We may think of adding something else in the future, but most of graphql APIs rely on this id
Shamhaad
@shamhaad180
Jul 16 2018 08:27
Sounds good.
Marcin Gębala
@maarcingebala
Jul 16 2018 08:27
You're welcome :) The API that we've just released is in very early stage so some things may be yet missing or unclear, we'll be improving that
Shamhaad
@shamhaad180
Jul 16 2018 08:28
Sure. :)
RoelantStegmann
@RoelantStegmann
Jul 16 2018 08:40
When debug=True I keep getting a Suspicious File Error: The joined path (/images/placeholder255x255.png) is located outside of the base path component (/home/user/lib/python3.6/versatileimagefield/static) but I can reach the static files via domain.com/static/images.com. When I change to debug=False I can reach my site, but the links to the static files break (including the js css assets)
Any thoughts? :)
Shamhaad
@shamhaad180
Jul 16 2018 08:46
Is your STATIC_URL = '/static/' set?
If DEBUG is false, you should look at the link I sent earlier. It explains why that is happening.
RoelantStegmann
@RoelantStegmann
Jul 16 2018 09:24
Thanks! Missed that link. Solves the DEBUG=False setting, still leaves me wondering about the opposite.
RoelantStegmann
@RoelantStegmann
Jul 16 2018 10:35
Is there a method to 'unpopulate' the db? :)
zchlebicki
@zchlebicki
Jul 16 2018 10:36
Drop it and make new one?
RoelantStegmann
@RoelantStegmann
Jul 16 2018 11:05
Haha yes I made the mistake to already add some of my own stuff, which was stupid. Anyway after flush I have a clean database, but get a 500 error when adding products (django.db.models.fields.related_descriptors.RelatedObjectDoesNotExist: Site has no settings.) and a 500 error when accessing the website Internal Server error /en/. Seems I dropped more than just the products :)
Kuntal
@Kuntal-KK
Jul 16 2018 11:52
I am trying to add google map autocomplete feature to the delivery address form from last 2 days. But I could not understand how to do that. Can anyone help me? @pankaj28843
Shamhaad
@shamhaad180
Jul 16 2018 14:02
@RoelantStegmann so your settings.py has STATIC_URL set?
RoelantStegmann
@RoelantStegmann
Jul 16 2018 14:39
@shamhaad180 yes