From 20dcfb463f0a09f1743b861e6bfd1a54aa8fd77f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20L=C3=A9ger?= Date: Tue, 23 Oct 2018 10:38:33 -0400 Subject: [PATCH 1/2] Added Django logger to loggers when Raven is not activated, hardcoded settings for webpack dev server --- kobo/settings.py | 7 ++++++- webpack/dev.server.js | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/kobo/settings.py b/kobo/settings.py index 3b3687acd6..6cd59a54cb 100644 --- a/kobo/settings.py +++ b/kobo/settings.py @@ -534,7 +534,12 @@ def __init__(self, *args, **kwargs): 'handlers': ['console'], 'level': 'DEBUG', 'propagate': True - } + }, + 'django.db.backends': { + 'level': 'ERROR', + 'handlers': ['console'], + 'propagate': True + }, } } diff --git a/webpack/dev.server.js b/webpack/dev.server.js index 480d37a5d0..fc9732ffbb 100644 --- a/webpack/dev.server.js +++ b/webpack/dev.server.js @@ -3,7 +3,7 @@ const path = require('path'); const webpack = require('webpack'); const WebpackCommon = require('./webpack.common'); const BundleTracker = require('webpack-bundle-tracker'); -var publicPath = 'http://localhost:3000/static/compiled/'; +var publicPath = 'http://kpi.kobo.local:3000/static/compiled/'; module.exports = WebpackCommon({ mode: "development", @@ -22,7 +22,8 @@ module.exports = WebpackCommon({ disableHostCheck: true, hot: true, headers: {'Access-Control-Allow-Origin': '*'}, - port: 3000 + port: 3000, + host: '0.0.0.0' }, plugins: [ new BundleTracker({path: __dirname, filename: '../webpack-stats.json'}), From fe2157c7e91df36145826e033633bf67df2d4d79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20L=C3=A9ger?= Date: Tue, 23 Oct 2018 17:35:09 -0400 Subject: [PATCH 2/2] Use domain name instead of localhost when it's available to make webpack works with local domain names --- webpack/dev.server.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webpack/dev.server.js b/webpack/dev.server.js index fc9732ffbb..884cbd5472 100644 --- a/webpack/dev.server.js +++ b/webpack/dev.server.js @@ -3,7 +3,11 @@ const path = require('path'); const webpack = require('webpack'); const WebpackCommon = require('./webpack.common'); const BundleTracker = require('webpack-bundle-tracker'); -var publicPath = 'http://kpi.kobo.local:3000/static/compiled/'; +var isPublicDomainDefined = process.env.KOBOFORM_PUBLIC_SUBDOMAIN && + process.env.PUBLIC_DOMAIN_NAME; +var publicDomain = isPublicDomainDefined ? process.env.KOBOFORM_PUBLIC_SUBDOMAIN + + '.' + process.env.PUBLIC_DOMAIN_NAME : 'localhost'; +var publicPath = 'http://' + publicDomain + ':3000/static/compiled/'; module.exports = WebpackCommon({ mode: "development",