Please advice whether is it correct method to change the urlconf and templatedir variables of a django settings file dynamically within a custom middleware function based on the site requested.
views:
43answers:
1
+1
A:
No. I don't know why you would want to do this. If you have multiple sites, the correct way to serve them is with multiple WSGI instances, each pointing at separate settings.py and urls.py files.
Edit after comment: This has nothing to do with the sites framework, which is completely optional. As I say, if you want to serve multiple sites, use multiple .wsgi
scripts each pointing to a separate urls.py
and settings.py
. All the rest of the code can be the same.
Daniel Roseman
2010-08-01 08:38:16
ok, If I need a common functionality for some site how can I achieve without having to replicate the coding
Joseph
2010-08-01 09:04:59
I was checking whether multtiple sites can be run from single instance of a django code base. without using the django buitin site framework. for better code reusability
Joseph
2010-08-01 09:11:29