These are chat archives for mirumee/saleor

22nd
Aug 2018
NyanKiyoshi
@NyanKiyoshi
Aug 22 2018 09:12
@milesstevenson Saleor provides a GraphQL API, more information here https://saleor.readthedocs.io/en/latest/architecture/graphql.html
Николай Инкогнито
@mmmsvit_gitlab
Aug 22 2018 10:08
6861e4f816.jpg
Hello, are have any plans integrate notifications, like django-notify-x? this can be usefull full cart update, for help service/tickets, etc...
Stephen Moloney
@stephenmoloney
Aug 22 2018 13:53
Anyone have an idea why i am getting this error.
Николай Инкогнито
@mmmsvit_gitlab
Aug 22 2018 13:53
штеуктфдл уккщк
internal error
of python
Stephen Moloney
@stephenmoloney
Aug 22 2018 13:54
I'm using an image from the dockerhub , https://hub.docker.com/r/mirumee/saleor/tags/, 8c6b91012b3db67b8a54d4fb6517500a962a1cc1
Any clue, why though?
Николай Инкогнито
@mmmsvit_gitlab
Aug 22 2018 13:55
eror repeat?
Stephen Moloney
@stephenmoloney
Aug 22 2018 13:55
AWS_QUERYSTRING_AUTH ?
NyanKiyoshi
@NyanKiyoshi
Aug 22 2018 13:55
@stephenmoloney the AWS_QUERYSTRING_AUTH environment variable was set?
Stephen Moloney
@stephenmoloney
Aug 22 2018 13:55
yes to ""
if i run env in bash, i get AWS_QUERYSTRING_AUTH=
NyanKiyoshi
@NyanKiyoshi
Aug 22 2018 13:55
It's expecting a python literal, here True or False
Stephen Moloney
@stephenmoloney
Aug 22 2018 13:56
I though that get_bool_from_env would coerce it...
to False
NyanKiyoshi
@NyanKiyoshi
Aug 22 2018 13:56
It only checks if the value is set or not (in the environment or not)
Then parses it
Stephen Moloney
@stephenmoloney
Aug 22 2018 13:56
ok, so is it mandatory to specify the AWS variables, I thought that might be optional ?
NyanKiyoshi
@NyanKiyoshi
Aug 22 2018 13:57
No, it will default to False
Stephen Moloney
@stephenmoloney
Aug 22 2018 13:58
ok, so I need to set some defaults... I have a few that I am unsure of when you want them blank/false, so i'll outline them below:
  RECAPTCHA_PRIVATE_KEY: ""
  OPENEXCHANGERATES_API_KEY: ""
  VATLAYER_ACCESS_KEY: ""
  AWS_ACCESS_KEY_ID: ""
  AWS_SECRET_ACCESS_KEY: ""
  SENDGRID_USERNAME: ""
  SENDGRID_PASSWORD: ""
  EMAIL_URL: ""
  EMAIL_FILE_PATH: ""
  EMAIL_HOST_USER: ""
  EMAIL_HOST_PASSWORD: ""
  EMAIL_HOST: ""
  EMAIL_PORT: ""
  EMAIL_BACKEND: ""
  EMAIL_USE_TLS: ""
  EMAIL_USE_SSL: ""
and also
  AWS_LOCATION:
  AWS_STORAGE_BUCKET_NAME: 
  AWS_MEDIA_BUCKET_NAME: 
  AWS_MEDIA_CUSTOM_DOMAIN:
  AWS_QUERYSTRING_AUTH:
  AWS_S3_CUSTOM_DOMAIN:
So, just wondering, which ones I must set to False to avoid failure
NyanKiyoshi
@NyanKiyoshi
Aug 22 2018 13:59
What is the reason that you are setting them despite not using them?
Stephen Moloney
@stephenmoloney
Aug 22 2018 14:00
I could leave them absent if not being used but it adds a bit more complexity to the configmap
I mean, I don't think there is a difference between VATLAYER_ACCESS_KEY: "" and just leaving it out, right ?
NyanKiyoshi
@NyanKiyoshi
Aug 22 2018 14:01
Just set AWS_QUERYSTRING_AUTH to "False", it seems to be the only issue
Stephen Moloney
@stephenmoloney
Aug 22 2018 14:02
Ok, thanks.
I'll enhance this as I go along - trying to leave them out based on a conditional but to start, i just want to get the thing working.
NyanKiyoshi
@NyanKiyoshi
Aug 22 2018 14:02
  EMAIL_FILE_PATH: ""
  EMAIL_HOST_USER: ""
  EMAIL_HOST_PASSWORD: ""
  EMAIL_HOST: ""
  EMAIL_PORT: ""
  EMAIL_BACKEND: ""
  EMAIL_USE_TLS: ""
  EMAIL_USE_SSL: ""
Those are automatically set from EMAIL_URL though (more info on #2147)
Stephen Moloney
@stephenmoloney
Aug 22 2018 14:04
yea, i hadn't got to that one yet... this same thing goes for redisurl, celerybrokerurl, postgres url..
it is creating a bit more work for me in the helm charts... but it's solvable.
so here i've added conditionality to the AWS variables, ie
  {{- if (eq .Values.settings.django.aws.enabled true) }}
  AWS_LOCATION: {{ .Values.settings.django.location | quote }}
  AWS_STORAGE_BUCKET_NAME: {{ .Values.settings.django.storageBucketName | quote }}
  AWS_MEDIA_BUCKET_NAME: {{ .Values.settings.django.mediaBucketName | quote }}
  AWS_MEDIA_CUSTOM_DOMAIN: {{ .Values.settings.django.mediaCustomDomain | quote }}
  AWS_QUERYSTRING_AUTH: {{ .Values.settings.django.queryStringAuth | quote }}
  AWS_S3_CUSTOM_DOMAIN: {{ .Values.settings.django.s3CustomDomain | quote }}
  {{- end }}
Another thing I noticed is that the settings.py leaves out ENV variables for quite a few of the settings.
I am thinking of making a PR to get as many as makes sense into the settings.py, it just seems more consistent ot have all rather than just some. At least those ones that are easily imaginably configurable.
Do folks normally write their own settings.py to add or override it ?
I'm guessing that is how it works.
NyanKiyoshi
@NyanKiyoshi
Aug 22 2018 14:08
Depends on the people.
I personally extend it if I need to add things to it (from .settings import * then set DJANGO_SETTINGS=saleor.settings_production) and use environment variables.
Stephen Moloney
@stephenmoloney
Aug 22 2018 14:09
Yea
I've built in an option into the helm chart to add your own overrides.settings.py optionally
as a configMap.
Stephen Moloney
@stephenmoloney
Aug 22 2018 14:16
removing the AWS_QUERYSTRING_AUTH variable worked BTW, thanks @NyanKiyoshi
Stephen Moloney
@stephenmoloney
Aug 22 2018 20:47
Just wondering, what is a suitable form for the SECRET_KEY... is there a recommended command for autogenerating one .... ? (no need to answer this tonight, tomorrow is fine, just getting it out before I forget)
NyanKiyoshi
@NyanKiyoshi
Aug 22 2018 20:55
Can do that on Python3.6 (and higher) to generate a 32 bytes token (more here https://docs.python.org/3/library/secrets.html)
python3 -c 'import secrets; print(secrets.token_urlsafe(32))'
Stephen Moloney
@stephenmoloney
Aug 22 2018 21:24
:thumbsup: