Django "Sites Framework" in development

I am development an app for a SAAS project. I am facing the multiple choices for manage multiple customers. One option is use the built-in “Sites Framework”, but I think there is a lack of documentation. Some questions I have are:

  1. How to manage multiple domains in development?
  2. Is it possible to use subdomains as domains?
  3. I would like to extend the Site model in order to add some fields, but that could break a lot of the built-in behavior. Do you think this is a good approach?

Another option that I am managing is to use the “Sites Framework” like example and built my own Tenants app.

Someone has experience with a similar situation and can give me advice about it?

Any help is welcome.

What do you mean by this? Why would development be any different for this than production, or development for any other project?

Yes. To the extent of my experience, there’s nothing saying that a “site” must be mapped to only a 2-level name.

Probably not - the generally recommended practice is to create a related model, one with a OneToOne relationship with the base model. That lets you add whatever functionality is needed without affecting the existing model.

Thanks @KenWhitesell

In development I use to use only as I think is the standard practice, how do you manage that in development.

Thanks for the other answers it makes very clear the path to follow in this aproach.

Oh, ok.

You can change your hosts file to locally assign dns names to addresses. (/etc/hosts on Unix-style systems and usually c:\Windows\System32\drivers\etc\hosts on Windows) You can assign any number of host names to any arbitrary address - your system will check that file before issuing a network-based DNS request.

1 Like