question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

make django-cms play nice with django-multisite

See original GitHub issue

django-multisite is an app that makes it possible to run multiple different domains mapped to different django.contrib.sites.Site with one django process.

It does this through a middleware that dynamically sets settings.SITE_ID.

cms.urls fetches the list of Apphooks at import time and then caches the result in the urls.py module. This is a problem when the SITE_ID changes in a later request.

Current workaround:

  • create a copy of cms.urls once per site
  • copy your root urls.py once per site. in it replace the url import for cms.urls with the copy.
  • add a custom middleware that sets request.urlconf and applyies set_urlconf() per domain
  • make a pr for django-multisite for a default implementation of the root_urlconf setting
  • make django-cms not rely on SITE_ID at import time. instead it should use the threadlocal site made available by set_urlconf()
  • make cms.middleware.utils.ApphookReloadMiddleware work as expected with multiple root urls

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:6
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
yakkycommented, Jun 14, 2016

@rodolfomartinez have a look at this https://github.com/nephila/djangocms-multisite (repo, packaging etc it’s still totally to be defined) @stefanfoulis @divio/django-cms-core do you think should stay as an addon?

0reactions
FinalAngelcommented, Jun 15, 2016

closing this as we’ll continue on djangocms-multisite

Read more comments on GitHub >

github_iconTop Results From Across the Web

make django-cms play nice with django-multisite #5185 - GitHub
django -multisite is an app that makes it possible to run multiple different domains mapped to different django.contrib.sites.
Read more >
Multi-Site Installation - django cms 3.11.0 documentation
For operating multiple websites using the same virtualenv you can use copies of manage.py , wsgi.py and different versions of settings and the...
Read more >
Django-cms for multiple websites - Stack Overflow
I have a global settings file plus one for each website that does only import all global settings and set "SITE_ID". from base...
Read more >
Django cms multisite possibilities : r/django - Reddit
I have a Django CMS site feeding three domains. It integrates well with the sites framework but apps you use (and write) have...
Read more >
Multi-site with Django CMS
Exactly. djangoCMS is great, because it makes use of Django, and does not try to duplicate already made, stable features. Sites framework is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found