Re: Multiple sites, single application in Django

2009-04-13 Thread Daniel C

Russell,
I am working through something similar and I think that the basic
structure would be to have project folders for each site plus a folder
for your shared applications (whose models use the 'Site' object and
'CurrentSiteManager'. Something like this:
/home/django/sharedapps/
/home/django/sharedapps/profiles
/home/django/sharedapps/accounts
/home/django/sharedapps/notification
/home/django/sharedapps/photos
/home/django/sharedapps/videos
/home/django/website1/
/home/django/website1/
/home/django/website1/settings.py
/home/django/website2/
/home/django/website2/apps
/home/django/website2/apps/uniquewebsite2app
/home/django/website2/settings.py
/home/django/multisite.db

Assuming your working django directory is '/home/django', you create a
directory named sharedapps and place the apps you want to work across
your sites there. So if you had applications like 'profiles',
'accounts', 'photos', etc. that both websites would use, place the
apps in a 'sharedapps' folder. You would need to make sure the
'sharedapp's folder was added to the environment path for each project
'website1' and 'website2'. The Pinax project basically does this by
modifying 'manage.py' and adding lines like 'sys.path.insert(0, join
(settings.PINAX_ROOT, "apps"))'. I'm thinking something like a '/home/
django/sharedsitesettings.py' might be a place to put this. And of
course you will also need to make sure the database is shared, so
perhaps you'd add database settings into that 'sharedsitesettings.py'
file. For a SQLite3 database, that could be the '/home/django/
multisite.db'

Looking at the Pinax project code has reminded me that Django is first
and foremost python, so I stopped thinking about django projects as
the base container for django...er, projects. I think what Django
calls a 'project' is a convenience for us to get started, but for
complex development, we need to remember that what Django creates is
just a directory with files in it.

Anyway, that is my take currently. Perhaps someone more knowledgeable
will come around and reveal a better way.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Multiple sites, single application in Django

2009-04-11 Thread creecode

Hello Russell,

I can't say this is best practice but my approach to a similar goal
has been to create projects for each website.  These projects/websites
are unrelated to each other as far as content goes but all install a
common set of apps, some off the shelf, some custom.  I have sites
installed for each project but not all of my apps are fully site aware
so I only use sites minimally at this time.

On Apr 11, 8:23 am, Russell McConnachie 
wrote:

> I still have not come up with a creative way to design a site
> which hosts multiple sites - providing different html layouts, style sheets.
>
> I am looking for someone to kind of explain to me some best practices on
> doing this

Toodle-looo.
creecode
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---