Skip to content

optimize MULTISITE_CMS_* settings #12

@jedie

Description

@jedie

The default from README:

MULTISITE_CMS_URLS={
    'www.example.com': 'tests.test_utils.urls1',
    'www.example2.com': 'tests.test_utils.urls2',
},
MULTISITE_CMS_ALIASES={
    'www.example.com': ('alias1.example.com', 'alias2.example.com',),
    'www.example2.com': ('alias1.example2.com', 'alias2.example2.com',),
},
MULTISITE_CMS_FALLBACK='www.example.com'
  1. You have to insert three times www.example.com -> What's about DRY ?
  2. You didn't see the SITE_ID

What's about something like this:

MULTISITE_CMS={
    1: { # SITE_ID == 1
        'DOMAIN': 'www.example.com',
        'URLS': 'example_project.urls1',
        'ALIASES': ('alias1.example.com', 'alias2.example.com',)
    },
    2: {  # SITE_ID == 2
        'DOMAIN': 'www.example2.com',
        'URLS': 'example_project.urls2',
        'ALIASES': ('alias1.example2.com', 'alias2.example2.com',)
    },
}
MULTISITE_CMS_FALLBACK=1 # SITE_ID == 1

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions