These are chat archives for mirumee/saleor

26th
Nov 2018
padiyar83
@padiyar83
Nov 26 2018 01:55
hey guys, I am trying to get a the dev. environment set up and following this process https://saleor.readthedocs.io/en/latest/customization/docker.html, I keep on getting this error, when I do the docker-compose up, was curious if any of you have seen this before celery_1_d1f34dcd8999 | [2018-11-25 19:53:22,827: WARNING/MainProcess] /usr/local/lib/python3.6/site-packages/celery/fixups/django.py:200: UserWarning: Using settings.DEBUG leads to a memory leak, never use this setting in production environments! celery_1_d1f34dcd8999 | warnings.warn('Using settings.DEBUG leads to a memory leak, never ' celery_1_d1f34dcd8999 | [2018-11-25 19:53:22,832: INFO/MainProcess] celery@f136499122c7 ready. celery_1_d1f34dcd8999 | [2018-11-25 19:53:22,927: CRITICAL/MainProcess] Unrecoverable error: AttributeError("'float' object has no attribute 'items'",) celery_1_d1f34dcd8999 | Traceback (most recent call last):
here are the full logs from the error …
Muhammad Bandawa
@mdnur89
Nov 26 2018 05:50
Hi there, I'm from issue #3313 and I wanted to know if it's possible to do <npm install> on another machine and if it runs successfully can I just copy the node_modules folder to my development machine or it's much more complicated than just a copy and paste.
Muhammad Bandawa
@mdnur89
Nov 26 2018 06:04
Please advise.
Eli Spizzichino
@diramazioni
Nov 26 2018 07:24
@wulaaf good catch! I can see this happening on mobile
NyanKiyoshi
@NyanKiyoshi
Nov 26 2018 09:10
@mdnur89 you can
Eli Spizzichino
@diramazioni
Nov 26 2018 11:14
Are you aware that the language picker at the top doesn't actually work? I doesn't redirect to the selected language at all it stays at the default one
checked with firefox and chrome both on pc and mobile. (No error on the console)
NyanKiyoshi
@NyanKiyoshi
Nov 26 2018 11:25
@diramazioni on demo? Is it the issue #3154?
Eli Spizzichino
@diramazioni
Nov 26 2018 11:26
sorry now in my local dev macchine it works I think the cache got refreshed or something. But on the https://demo.getsaleor.com/pl/ you can see the problem and it doesn't look working
NyanKiyoshi
@NyanKiyoshi
Nov 26 2018 11:27
@wulaaf can you open an issue, and reference #2845? With the steps:
  1. Open https://demo.getsaleor.com/en/products/white-plimsolls-88/ ;
  2. Click the right arrow;
  3. Resize the window.
@diramazioni what am I supposed to look for?
Eli Spizzichino
@diramazioni
Nov 26 2018 11:28
@NyanKiyoshi I've run compilemessages few times here so I think the message on the master are out of sync
NyanKiyoshi
@NyanKiyoshi
Nov 26 2018 11:28
image.png
That's what I see
Eli Spizzichino
@diramazioni
Nov 26 2018 11:28
@NyanKiyoshi try to switch lancguage on the live demo if you can...
language*
NyanKiyoshi
@NyanKiyoshi
Nov 26 2018 11:31
Okay, I have the issue too
Open an issue about this
Eli Spizzichino
@diramazioni
Nov 26 2018 11:45
NyanKiyoshi
@NyanKiyoshi
Nov 26 2018 11:46
Could you add the steps to reproduce the issue? It makes it easier for people to handle the issue
Eli Spizzichino
@diramazioni
Nov 26 2018 11:49
Just the official linked docs. Anyway, I'll double check by cloning a fresh instance and report
Stephen Moloney
@stephenmoloney
Nov 26 2018 11:50
@diramazioni This command I think is the last one I need for my own deployment and the helm chart I'm writing ....
python manage.py makemessages -l en --extension=email,html,mjml,py,txt --ignore="templates/templated_email/compiled/
I was wondering if you wouldn't mind explaining what it does ?
And where txpull fits in all of it. I'm still a bit confused by email template compilation and translations compilations.
Eli Spizzichino
@diramazioni
Nov 26 2018 11:53
@stephenmoloney read here https://docs.djangoproject.com/en/2.1/topics/i18n/translation/#localization-how-to-create-language-files and you'll understand it :) it refresh the translation message in the the template and codes
https://www.transifex.com/ it's all another subject and it's not mandatory
Stephen Moloney
@stephenmoloney
Nov 26 2018 11:57
Yea, thanks @diramazioni , From reading the docs i need to run python manage.py makemessages and then immediately follow it with python manage.py compilemessages and do this every time a template file is changed or a translation .po file is changed ?
Eli Spizzichino
@diramazioni
Nov 26 2018 11:57
@stephenmoloney yes
Stephen Moloney
@stephenmoloney
Nov 26 2018 11:58
Is this something that should happen inside the Dockerfile (here https://github.com/mirumee/saleor/blob/master/Dockerfile#L61) ?
As in, it's a static thing ?
Eli Spizzichino
@diramazioni
Nov 26 2018 11:59
@NyanKiyoshi I've cloned a fresh copy from master however it complains that saleor/static/assets doesn't exist...
NyanKiyoshi
@NyanKiyoshi
Nov 26 2018 11:59
You need to compile the assets. npm i && npm run build-assets
Eli Spizzichino
@diramazioni
Nov 26 2018 12:00
@NyanKiyoshi ops sorry got distracted
@stephenmoloney of course is static
Stephen Moloney
@stephenmoloney
Nov 26 2018 12:01
Then I'm just wondering why this is not baked into the Dockerfile ?
Eli Spizzichino
@diramazioni
Nov 26 2018 12:02
@stephenmoloney I've haven't deploy it yet I've no experience in that
Stephen Moloney
@stephenmoloney
Nov 26 2018 12:03
Sure. There might be a reason for that, have used that command enough yet.
does anyone know how the email compilation works and how npm run build-emails relates to python manage.py makemessages -l en --extension=email,html,mjml,py,txt --ignore="templates/templated_email/compiled/
Eli Spizzichino
@diramazioni
Nov 26 2018 12:09
@NyanKiyoshi actually checking out the latest on the master it seems that language picker works out of the box. I was using a code base of a couple a weeks ago and I had to apply migration
NyanKiyoshi
@NyanKiyoshi
Nov 26 2018 12:10
Odd. I will check locally whenever I can.
Eli Spizzichino
@diramazioni
Nov 26 2018 12:10
during migration I had a bunch of error like:
FileNotFoundError: [Errno 2] No such file or directory: '/home/es/data/django/saleor-master/media/products/saleordemoproduct_beer-01_1.png'
ERROR saleor.product.templatetags.product_images Thumbnail fetch failed [PID:6199:Thread-42]
Traceback (most recent call last):
File "/home/es/data/django/saleor-master/saleor/product/templatetags/product_images.py", line 90, in get_thumbnail
thumbnail = getattr(instance, method)[used_size]
File "/home/es/.virtualenvs/saleor/lib/python3.6/site-packages/versatileimagefield/datastructures/sizedimage.py", line 149, in getitem
height=height
File "/home/es/.virtualenvs/saleor/lib/python3.6/site-packages/versatileimagefield/datastructures/sizedimage.py", line 201, in create_resized_image
path_to_image
File "/home/es/.virtualenvs/saleor/lib/python3.6/site-packages/versatileimagefield/datastructures/base.py", line 140, in retrieve_image
image = self.storage.open(path_to_image, 'rb')
File "/home/es/.virtualenvs/saleor/lib/python3.6/site-packages/django/core/files/storage.py", line 33, in open
return self._open(name, mode)
File "/home/es/.virtualenvs/saleor/lib/python3.6/site-packages/django/core/files/storage.py", line 218, in _open
return File(open(self.path(name), mode))
Stephen Moloney
@stephenmoloney
Nov 26 2018 12:12
that's the populate db command rather than the migration. could be a permissions issue for /media.
NyanKiyoshi
@NyanKiyoshi
Nov 26 2018 12:15
The file is not found though
@diramazioni you can set CREATE_IMAGES_ON_DEMAND to False in the meantime
Eli Spizzichino
@diramazioni
Nov 26 2018 12:16
sorry I had a fresh copy and did not populate the db because it was already populated so I had no media directory. All working btw
NyanKiyoshi
@NyanKiyoshi
Nov 26 2018 12:17
Yeah
Eli Spizzichino
@diramazioni
Nov 26 2018 12:19
So it could be simply be that the on-line version of the demo is not the latest on master? Could this happen or you have a CI environment?
NyanKiyoshi
@NyanKiyoshi
Nov 26 2018 12:21
No clue, I need to test on my fork. In production I never had this issue, and I don't recall any language picker changes made since then. It could be a requirement failing (e.g. django 2.1.x). In the demo store it sets the language but then redirects to the previous language, which is something that I wrote tests against in the past.
Eli Spizzichino
@diramazioni
Nov 26 2018 12:25
Sorry maybe my poor English doesn't let me express fully :) My question was just to understand if the deployed version at http://demo.getsaleor.com it's always == master on github
Filip Kucharczyk
@Pacu2
Nov 26 2018 12:28
@padiyar83 Hi, have you seen andymccurdy/redis-py#1068 Seems like wrong version of the packages installed.
mvondo
@mvondo
Nov 26 2018 12:33
how to use dropbox storage as a file storage server of Django saleor
Filip Kucharczyk
@Pacu2
Nov 26 2018 12:39
@mvondo We are using django-storages package, so the docs linked by NyanKiyoshi should be helpful, just plug&play I suppose
mvondo
@mvondo
Nov 26 2018 13:15
ok thank you