views:

579

answers:

1

Hi Djangonauts,

I am almost done developing a Django project (with a few pluggable apps).

I want to offer this project as a SaaS (something like basecamp).

i.e: project1.mysaas.com , project2.mysaas.com etc

I seek your expertise in showing me the path.

Ways I have thought of are:

  • 1 use Sites to define site specific settings.py
  • 2 a middleware to detect request then set settings accordingly
  • 3 create Django project (taking in pluggable apps) for each site

Thanks.

btw, i am a total newbie.

+2  A: 

Your requirements aren't at all clear but I'll assume you aren't doing anything tricky and also assume your "project1", "project2" are customer names which won't need any special branding.

First, about your ideas:

  1. You probably won't need to use the sites framework unless each site is branded differently. The site framework works well doing what it was designed to do, which is present different views of a common set of data.

  2. This would work but probably is not the best approach IMO.

  3. This is unmanageable.

Now, this is a really hard topic because there are so many issues. A decent place to start reading is the High Scalability Blog and especially relevant for you would be the post on 37signals Architecture.

Finally, here's what I am doing in a small SaaS app (that doesn't need extreme scalability):

  • Use the sites framework (because user pages will be branded by the partner/reseller and each partner has a unique login page)

  • Use mod_wsgi to minimize resource usage from all the Django instances.

  • Instead of middleware I put a common code at the top of every view that identifies the company of the user. I need this for logic in the views which is why I don't think it's useful in middleware.

Van Gale
thank you very much.the simplest way to illustrate what I am trying to do is that the Django project I am creating is equivalent to a Basecamp. Then I would like to offer this project to multiple users - each having his/her own project space like Basecamp.