Skip to content

Conversation

@wesleyboar
Copy link
Member

@wesleyboar wesleyboar commented Sep 13, 2024

Overview

Allow switching between multiple sites via domain name.

Related

Changes

  • added middleware
  • added example settings for middleware

Testing

  1. Be able to access a server at multiple domains e.g.
  2. In custom_app_settings.py, add new middleware to CUSTOM_MIDDLEWARE e.g.
    CUSTOM_MIDDLEWARE = ['taccsite_cms.middleware.settings.DynamicSiteIdMiddleware']
  3. Set current CMS SITE to one of those domain names e.g.
    • Domain name: 0.0.0.0:8000
    • Display name: 0.0.0.0:8000
  4. Create new CMS SITE with the other domain names e.g.
    • Domain name: localhost:8000
    • Display name: localhost:8000
  5. Visit 0.0.0.0:8000.
  6. Create/View a unique page.
  7. Visit localhost:8000.
  8. Create/View a unique page.
  9. Switch between the sites using URL.
  10. Verify each site only shows its unique page.

Note

You may need to reload page after site/domain switch to refresh the CMS toolbar output.

UI

Sites (Admin) 0.0.0.0:8000 localhost:8000
multisite via domain - sites multisite via domain - 0000 multisite via domain - localhost
multisite.via.domain.mov

@wesleyboar wesleyboar added feature A new feature or replacement of present feature effort S Small effort task (~½ a week) — does not include review time proposal Proposal or request for new task labels Sep 13, 2024
@wesleyboar wesleyboar marked this pull request as ready for review September 13, 2024 21:22
wesleyboar added a commit that referenced this pull request Sep 13, 2024
I do not think it is a useful solution for TUP-706.

The code/feature is archived in #873:
#873
wesleyboar added a commit that referenced this pull request Sep 13, 2024
I do not think it is a useful solution for TUP-706.

The code/feature is archived in #873:
#873
@wesleyboar wesleyboar mentioned this pull request May 15, 2025
28 tasks
wesleyboar added a commit that referenced this pull request May 28, 2025
* refactor: CMD-97 breadcrumbs for news via 1 template

* idea: TUP-706 4.a.i change RSS feed render ⚠️

NOT WORKING! Fails with:

> NoReverseMatch at /feed/
> '' is not a registered namespace

* refactor: TUP-706 rename and document blog block

* feat: TUP-706 render page with only (*_)content

* fix: TUP-706 disable failed djangocms_blog_c… url

* idea!: TUP-706 render blog base via custom app

Fails, because it renders nothing.

* feat!: TUP-706 render remote url content

Load `/blog/remote`.

BREAKING CHANGE: Changed `/blog` to `/blog/local`

* chore: TUP-706 move an import higher in file

* feat: TUP-706 render remote url via setting

* fix: TUP-706 render blog customizations

* fix: TUP-706 render feed ⚠️

⚠️ Does NOT render feed items.

* docs: TUP-706 describe each URL's problem

* docs: TUP-706 describe each URL goal and status

* feat: TUP-706 A.1+3.c remote markup via template

* feat: TUP-706 A.1.a. support BLOG_MULTISITE

* fix: TUP-706 A.1.a. cannot login to site 2

* Revert "fix: TUP-706 A.1.a. cannot login to site 2"

This reverts commit 6bece39.

This did not fix anything. `SESSION_COOKIE_SECURE=False` is still required locally.

* docs: TUP-706 feed status (ineffectual)

* docs: tup-706 urls for local and remote

* feat(poc): TUP-706 get news from remote url

Messy but functional!

* chore: remove test print statements from feeds

* core: clean up views

* core: clean up views more

* refactor: switch order of methods in view class

* feat: TUP-706 edit links via get_client_markup()

* fix: TUP-706 broken links

- ✓ fix links to articles
- ✓ fix pagination links

* chore: remove SITE_ID middleware

I do not think it is a useful solution for TUP-706.

The code/feature is archived in #873:
#873

* chore: delete cruft from messy merge

* refactor: djangocms_blog_custom… → remote_content

This changes remote blog load to be remote anything load.

This removes the failed custom feed (archived in #874):
#874

* fix: load raw markup from remote site

* fix: load raw markup from remote site

* style: move parameter

* feat!: change mage source not article link

BREAKING CHANGE: images will not load, cuz of CORS. Solve via headers.

* fix: links to articles should open on source

* docs: how to test PR #868

* docs: fix how to test PR #868

* feat: (TEMPORARY) dynamic site id

* docs: polish how to test PR #868

* fix: use settings for paths

* feat: configurable template

* refactor!: define template in URL not settings

* refactor!: fix rel href paths, lose template param

Gotta add back in support for tempalte param, and other CMS params. Working on it after this.

* fix: tempalte param (and other cms params)

KNOWN ISSUE: Frightening regex HTML manipulation.

* docs: known issues

* refactor: use beautiful soup not regex

* docs: no major known issues

* refactor: rename a function

* chore; remove dumb comments

* fix: support cms params in all href values

* fix: do not try to load link rel=stylesheets

* refactor: simplify href/src replacements

* docs: comments

* docs: how to convert (temp file)

* feat!: use repo Core-CMS-Plugin-Remote-Content

https://github.com/wesleyboar/Core-CMS-Plugin-Remote-Content

BREAKING CHANGE: Repo has bug (see its issue #1)

* refactor: replace internal app with external app

* refactor: remove middleware

* feat: update plugin

* chore: delete outdated code

Plugin handles this stuff now, and differently.

* chore: update plugin (get improvements)

* chore: update plugin (get better admin ui)

* chore: update plugin (get better, refactored code)

* test: djangocms_tacc_remote_content

* chore: djangocms_tacc_remote_content via release

* fix: remove extraneous dependency

* fix: absolute urls for links by default

* fix: keep relative urls via new settings

* feat: do not passthrough cms query params

* chore: v0.2.0

* refactor!: rename raw.html to bare.html

Only pages testing this  TUP-706 feature used `raw.html`.

BREAKING CHANGE: Any pages using `raw.html` must switch to `bare.html`

* chore: rename raw.html to bare.html in plugin

* chore: rename bare.html to plain.html in plugin

* chore: v0.3.0

* chore: TACC/Core-CMS-Plugin-Remote-Content

* fix: rename bare.html file to plain.html

* chore: v0.3.1

* chore: v0.3.2

* chore: v0.3.3

* feat: let admin change how to open external news
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort S Small effort task (~½ a week) — does not include review time feature A new feature or replacement of present feature proposal Proposal or request for new task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants