These are chat archives for mirumee/saleor

17th
Sep 2018
Николай Инкогнито
@mmmsvit_gitlab
Sep 17 2018 15:51
Hi all, i try use nginx in suctom domain for static files STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static') STATIC_URL = 'http://localhost:81/static/' but http://localhost:8000/static/assets/storefront.css and http://localhost:8000/static/assets/storefront.js stil use django url, how fix ?
in webpack-bundle.json steel old paths, this is bug? how corecct regenerate this file? Or i simple manual fix him and all work now fine
Николай Инкогнито
@mmmsvit_gitlab
Sep 17 2018 16:25
to have this problem with pass-invisible.svg
NyanKiyoshi
@NyanKiyoshi
Sep 17 2018 16:37
@mmmsvit_gitlab yeah the compiled webpack-bundle.json is outdated. Right now you have to set the environment variable STATIC_URL (e.g.: say your website static path is http://static.example.com/subfolder/, you set STATIC_URL to http://static.example.com/subfolder/). Then, run npm run build-assets --production.
Николай Инкогнито
@mmmsvit_gitlab
Sep 17 2018 16:56
th
i think more usable way will be create manage.py command for npm works with import env from settings.py
i try do this
Lebzanwa
@Lebzanwa
Sep 17 2018 17:38
How to set 'ALLOWED_HOSTS' in environment variable..?
Николай Инкогнито
@mmmsvit_gitlab
Sep 17 2018 17:39
coma separated
Lebzanwa
@Lebzanwa
Sep 17 2018 17:45
@mmmsvit_gitlab how?
NyanKiyoshi
@NyanKiyoshi
Sep 17 2018 17:54
Well, @Lebzanwa you are using bash for Windows if I recall correctly? So it would be export ALLOWED_HOSTS='127.0.0.1,localhost' for example
NyanKiyoshi
@NyanKiyoshi
Sep 17 2018 18:50
Do you think the dashboard-2.0 tests are failing on Windows because the locale may have a different currency format? Should we consider this is a bug? https://ci.appveyor.com/project/NyanKiyoshi/saleor/build/1.0.105/job/5xdl4bn71ui6p3m4#L639
Filip Kucharczyk
@Pacu2
Sep 17 2018 18:57
@NyanKiyoshi Something was on with those snapshots today, https://github.com/mirumee/saleor/pull/2882/files
NyanKiyoshi
@NyanKiyoshi
Sep 17 2018 19:03
Thanks, that's weird because I told the CI to use node 10. I will double check that then!
NyanKiyoshi
@NyanKiyoshi
Sep 17 2018 19:12
It was using 8.x anyway so yeah, thanks :wink:
Николай Инкогнито
@mmmsvit_gitlab
Sep 17 2018 19:39
any know how fix Reason: CORS header 'Access-Control-Allow-Origin' missing
if use separate server for static (images load normal, but js not execute)
?
NyanKiyoshi
@NyanKiyoshi
Sep 17 2018 19:43
What are you using to serve the static files?
Anyway, you should tell your web server that is serving the static files to add the CORS headers, example:
access-control-allow-methods: GET, HEAD
access-control-allow-origin: *
Николай Инкогнито
@mmmsvit_gitlab
Sep 17 2018 19:52
nginx
NyanKiyoshi
@NyanKiyoshi
Sep 17 2018 19:54
This should do it
add_header Access-Control-Allow-Methods 'GET, HEAD';
add_header Access-Control-Allow-Origin '*';
Test like that then customize the allowed origin
Николай Инкогнито
@mmmsvit_gitlab
Sep 17 2018 20:24
add_header 'Access-Control-Allow-Methods' 'GET, HEAD'; add_header 'Access-Control-Allow-Origin' '*'; this work fine!) th! and if off debug_toolbar in pycharm debugmode=True pahe load 1 sec.) i happy)
page load*
Николай Инкогнито
@mmmsvit_gitlab
Sep 17 2018 20:29
my nginx configuration, maybe can help for you too)
this work on windows