mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-10 15:04:52 +03:00
Fix email links when using Docker with Gulp
This commit is contained in:
parent
52eebeea1d
commit
7e96773d6e
|
@ -11,7 +11,7 @@ SECRET_KEY = env(
|
||||||
default="!!!SET DJANGO_SECRET_KEY!!!",
|
default="!!!SET DJANGO_SECRET_KEY!!!",
|
||||||
)
|
)
|
||||||
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
|
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
|
||||||
ALLOWED_HOSTS = ["localhost",{% if cookiecutter.js_task_runner == 'Gulp' and cookiecutter.use_docker == 'y' %} "django",{% endif %} "0.0.0.0", "127.0.0.1"]
|
ALLOWED_HOSTS = ["localhost", "0.0.0.0", "127.0.0.1"]
|
||||||
|
|
||||||
# CACHES
|
# CACHES
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
|
@ -127,12 +127,21 @@ function initBrowserSync() {
|
||||||
`${paths.js}/*.js`,
|
`${paths.js}/*.js`,
|
||||||
`${paths.templates}/*.html`
|
`${paths.templates}/*.html`
|
||||||
], {
|
], {
|
||||||
|
// https://www.browsersync.io/docs/options/#option-proxy
|
||||||
{%- if cookiecutter.use_docker == 'n' %}
|
{%- if cookiecutter.use_docker == 'n' %}
|
||||||
proxy: "localhost:8000"
|
proxy: 'localhost:8000'
|
||||||
{% else %}
|
{% else %}
|
||||||
proxy: "django:8000",
|
proxy: {
|
||||||
// Browsersync may open the browser when ready, but it doesn't work from
|
target: 'django:8000',
|
||||||
// inside a container, so set this option to false
|
proxyReq: [
|
||||||
|
function(proxyReq) {
|
||||||
|
// Set to the browsersync host & port to have email links working
|
||||||
|
proxyReq.setHeader('Host', 'localhost:3000')
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
// https://www.browsersync.io/docs/options/#option-open
|
||||||
|
// Disable as it doesn't work from inside a container
|
||||||
open: false
|
open: false
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,6 +95,7 @@ services:
|
||||||
command: npm run dev
|
command: npm run dev
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
|
# Expose browsersync UI: https://www.browsersync.io/docs/options/#option-ui
|
||||||
- "3001:3001"
|
- "3001:3001"
|
||||||
|
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user