make django-cms play nice with django-multisite
See original GitHub issuedjango-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 applyiesset_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 byset_urlconf()
- make
cms.middleware.utils.ApphookReloadMiddleware
work as expected with multiple root urls
Issue Analytics
- State:
- Created 7 years ago
- Reactions:6
- Comments:13 (8 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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?
closing this as we’ll continue on djangocms-multisite