Sorry, last one I promise -- (kid no longer crying) I was indeed very confused about the Sites framework. I was thinking that there was a way around having to have multiple mod_wsgi scripts and being able to run multiple sites from one "process" of django. What I think is meant is that multiple sites using one django-project (and all its apps, etc).
It just so happened that my installation, each site is going to have its own app, and therefore I was seriously confusing myself. I know now the my approach is: site1.settings site2.settings and in each of those I specify the SITE_ID and the templates dir. When I actually deploy -- my mod.wsgi script will be different for each vhost in apache. I was thinking for some reason I could get away with just one mod_wsgi "process". in my dev env, I will have to kick off serveral "manage.py runserver" processes using the --settings parameter to spedify different settings and set them to run on different ports... (By the way this is all stuff I knew because we're doing it on another project, but I though we must be doing it wrong -- apparently we're not, thats how its done, so we were right for once). I was thinking all along that there was a "better" way. Thanks for your help everyone! P.S. I may still look into site skinz by Bruce, but for now, this way is finally clear to me when i think about it from the apache vhost perspective... www.site1.com uses site1.settings .www.site2.com uses site2.settings each with their own wsgi handler script.... etc.... On Tue, Aug 25, 2009 at 11:07 PM, Ryan Headley <[email protected]>wrote: > To those following along at home -- I've had the Eureka moment. > > will fill anyone interested in tomorrow...kid is crying > > > On Tue, Aug 25, 2009 at 10:40 PM, Ryan Headley <[email protected]>wrote: > >> Bruce, >> >> You are correct, I am apparently mixing up "Sites" versus "Apps" >> >> Basically, I have a large client that wants several store fronts all >> managed from one Satchmo instance. >> >> I'm having trouble setting up the project such that Store A has its custom >> products as well as look/feel and Store B has its custom products as well as >> look/feel. >> >> >> What I have is a project called "estore" >> Underneath that I have the usual Django stuff. >> >> My thought was I would create an "app" for each storefront to house the >> customized pieces. In this case we'll stick with generics so >> Underneath estore I have an app "StoreA" that has its own models >> inheriting from Satchmo's product module. >> >> For now this is all well and good because they won't be launching the >> second store until later this year, so it gives me some time. my thought >> was that I would start another app called "StoreB" that would have its own >> custom products (again extending from Satchmo's product model). Where I am >> running into confusing is that StoreA will need a completely different set >> of customized templates than StoreB -- this is what I can't figure out. >> >> I "could" kick off a process for each store and specify a different >> settings file for each "app" that only overwrites SITE_ID and TEMPLATE_DIRS, >> but that seems like it may not be the best way to go. I've tackled that >> before using mod_python and a telling it a different settings file for each >> instance, but is that the best approach? >> >> >> Pardon the rambling, its been a long night... >> >> >> >> >> >> On Tue, Aug 25, 2009 at 8:27 PM, Alex Robbins < >> [email protected]> wrote: >> >>> Ok, if every site has its own settings.py file (and I think they have to, >>> since SITE_ID is a setting), then you could just have a different >>> TEMPLATE_DIRS setting for each site. >>> >>> If you have two sites: store_a and store_b >>> >>> store_a_settings.py >>> TEMPLATE_DIRS = ( >>> '/home/username/src/templates/store_a/', >>> '/home/username/src/templates/generic/' >>> ) >>> >>> store_b_settings.py >>> TEMPLATE_DIRS = ( >>> '/home/username/src/templates/store_b/', >>> '/home/username/src/templates/generic/' >>> ) >>> >>> >>> http://docs.djangoproject.com/en/dev/ref/templates/api/#the-template-dirs-setting >>> >>> That might accomplish what you are hoping for. >>> >>> On Tue, Aug 25, 2009 at 7:31 PM, Ryan Headley <[email protected]>wrote: >>> >>>> >>>> That's not a bad idea. I must ask however if I am misinterpreting the >>>> point of the sites framework in django? If someone wants to run >>>> multiple sites from one django instance is writing your own template >>>> loader the way to keep templates separate? Just curious how others >>>> are handling this (satchmo or not) >>>> >>>> On 8/25/09, Alex Robbins <[email protected]> wrote: >>>> > If you really want the template looked up that way why not write your >>>> own >>>> > template loader? Just pull the source from one of the existing loaders >>>> but >>>> > don't look in so many places. >>>> > >>>> > http://docs.djangoproject.com/en/dev/ref/templates/api/#loader-types >>>> > >>>> > >>>> > On Tue, Aug 25, 2009 at 5:04 PM, Ryan Headley <[email protected] >>>> >wrote: >>>> > >>>> >> So its not as simple as just laying out a directory structure >>>> >> appropriately? >>>> >> >>>> >> Damn, here I was thinking I could have app1 find its templates in >>>> >> templates/app1 and app2 find its templates in app2, etc. >>>> >> >>>> >> I guess I had that impression from django itself -- *ugh* >>>> >> >>>> >> Thanks for the link, I'll take a look. >>>> >> >>>> >> Ryan >>>> >> >>>> >> On Tue, Aug 25, 2009 at 5:01 PM, Bruce Kroeze <[email protected]> >>>> wrote: >>>> >> >>>> >>> >>>> >>> On Tue, Aug 25, 2009 at 2:24 PM, lifewithryan< >>>> [email protected]> >>>> >>> wrote: >>>> >>> > >>>> >>> > I have a need to run the "Multi-Shop" functionality. My question >>>> is, >>>> >>> > after reading some blog tutorials on GoSatchmo.com -- I think I >>>> have a >>>> >>> > directory structure like the one mentioned in the project layout >>>> >>> > tutorial: >>>> >>> > >>>> >>> > /estore -- this is my main directory with settings.py, urls.py >>>> etc. >>>> >>> > /appname -- my custom app holding my custom product >>>> >>> > __init__.py, models.py, etc >>>> >>> > /templates -- my templates >>>> >>> > /shop -- copied over from satchmo >>>> >>> > /product -- copied over from satchmo >>>> >>> > >>>> >>> > >>>> >>> > My plan is that for my other "shops" i'll just add another >>>> "appname" >>>> >>> > directory like above. Having said that, how do I ensure that my >>>> >>> > templates remain unique on a per-site basis? (Meaning StoreA >>>> shouldn't >>>> >>> > use the same templates as StoreB) >>>> >>> >>>> >>> You could use my "site-skins" module: >>>> >>> http://bitbucket.org/bkroeze/django-site-skins/ >>>> >>> >>>> >>> -- >>>> >>> Bruce Kroeze >>>> >>> http://www.ecomsmith.com >>>> >>> It's time to hammer your site into shape. >>>> >>> >>>> >>> >>>> >>> >>>> >> >>>> >> >>>> >> -- >>>> >> http://www.sudovi.com/ >>>> >> http://www.twitter.com/lifewithryan >>>> >> http://www.thecommontongue.com >>>> >> http://www.lifewithryan.com/ >>>> >> >>>> >> >>>> >> > >>>> >> >>>> > >>>> > > >>>> > >>>> >>>> -- >>>> Sent from my mobile device >>>> >>>> http://www.sudovi.com/ >>>> http://www.twitter.com/lifewithryan >>>> http://www.thecommontongue.com >>>> http://www.lifewithryan.com/ >>>> >>>> >>>> >>> >>> >>> >>> >> >> >> -- >> http://www.sudovi.com/ >> http://www.twitter.com/lifewithryan >> http://www.thecommontongue.com >> http://www.lifewithryan.com/ >> > > > > -- > http://www.sudovi.com/ > http://www.twitter.com/lifewithryan > http://www.thecommontongue.com > http://www.lifewithryan.com/ > -- http://www.sudovi.com/ http://www.twitter.com/lifewithryan http://www.thecommontongue.com http://www.lifewithryan.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Satchmo users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/satchmo-users?hl=en -~----------~----~----~----~------~----~------~--~---
