We ran into this problem and decided to extend Django's CurrentSiteMiddleware to allow for the specification of a default site to use in the case when you cannot determine the current site from the host of the incoming request.
-- Description of problem: https://groups.google.com/forum/#!topic/edx-code/5q6riHK2_P8
Custom Django middleware: https://github.com/edx/edx-django-sites-extensions/blob/master/django_sites_extensions/middleware.py
On Monday, March 21, 2016 at 9:08:27 PM UTC-4, jorr...@gmail.com wrote:
On Monday, March 21, 2016 at 9:08:27 PM UTC-4, jorr...@gmail.com wrote:
I'm wondering if I understand the Sites framework correctly... I'm building a forum-like project which will initially be accessible from mydomain.com . The project contains several apps like posts, members, ads, etc. Eventually I would like to create myseconddomain.com, which would have unique posts, but share the members, ads, etc. apps and look the same as the first site except for the domain name and title in the header. The code will be identical to the first site. Can I achieve this with a single project and several SITE_IDs, or am I correct in thinking that the Sites framework is only for sharing the same database across projects, and not the code files? And if there is a way to share the code files, how do you get around the fact that you set SITE_ID once in settings.py?
Thanks in advance for the help!
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ffc5f5ef-47d7-4a0e-a575-2a88e94b57b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment