mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-29 13:04:05 +03:00
Add condition to include .co.XX TLDs
This is best effort checking of domain names and creating the traefik rules. These two checks should cover most of the use cases.
This commit is contained in:
parent
ab93e28c88
commit
4021286be0
|
@ -26,9 +26,10 @@ certificatesResolvers:
|
|||
entryPoint: web
|
||||
|
||||
http:
|
||||
{%- set domain_dots = cookiecutter.domain_name.count('.') %}
|
||||
routers:
|
||||
web-router:
|
||||
{%- if len(cookiecutter.domain_name.split('.')) == 2 %}
|
||||
{%- if domain_dots == 1 or (domain_dots == 2 and '.co.' in cookiecutter.domain_name) %}
|
||||
rule: "Host(`{{ cookiecutter.domain_name }}`) || Host(`www.{{ cookiecutter.domain_name }}`)"
|
||||
{% else %}
|
||||
rule: "Host(`{{ cookiecutter.domain_name }}`)"
|
||||
|
@ -41,7 +42,7 @@ http:
|
|||
service: django
|
||||
|
||||
web-secure-router:
|
||||
{%- if len(cookiecutter.domain_name.split('.')) == 2 %}
|
||||
{%- if domain_dots == 1 or (domain_dots == 2 and '.co.' in cookiecutter.domain_name) %}
|
||||
rule: "Host(`{{ cookiecutter.domain_name }}`) || Host(`www.{{ cookiecutter.domain_name }}`)"
|
||||
{% else %}
|
||||
rule: "Host(`{{ cookiecutter.domain_name }}`)"
|
||||
|
|
Loading…
Reference in New Issue
Block a user