mirror of
https://github.com/Hopiu/cookiecutter-django.git
synced 2026-05-18 01:01:07 +00:00
Only consider TLDs while adding www route
Instead of checking for `.co.XX` on best effort basis, we only check for the single dot in the domain_name indicating no subdomain usage.
This commit is contained in:
parent
4021286be0
commit
9cf47898f4
1 changed files with 2 additions and 3 deletions
|
|
@ -26,10 +26,9 @@ certificatesResolvers:
|
|||
entryPoint: web
|
||||
|
||||
http:
|
||||
{%- set domain_dots = cookiecutter.domain_name.count('.') %}
|
||||
routers:
|
||||
web-router:
|
||||
{%- if domain_dots == 1 or (domain_dots == 2 and '.co.' in cookiecutter.domain_name) %}
|
||||
{%- if cookiecutter.domain_name.count('.') == 1 %}
|
||||
rule: "Host(`{{ cookiecutter.domain_name }}`) || Host(`www.{{ cookiecutter.domain_name }}`)"
|
||||
{% else %}
|
||||
rule: "Host(`{{ cookiecutter.domain_name }}`)"
|
||||
|
|
@ -42,7 +41,7 @@ http:
|
|||
service: django
|
||||
|
||||
web-secure-router:
|
||||
{%- if domain_dots == 1 or (domain_dots == 2 and '.co.' in cookiecutter.domain_name) %}
|
||||
{%- if cookiecutter.domain_name.count('.') == 1 %}
|
||||
rule: "Host(`{{ cookiecutter.domain_name }}`) || Host(`www.{{ cookiecutter.domain_name }}`)"
|
||||
{% else %}
|
||||
rule: "Host(`{{ cookiecutter.domain_name }}`)"
|
||||
|
|
|
|||
Loading…
Reference in a new issue