Login

Tag "site_id"

Snippet List

Dynamic SITE_ID thread-safe

Store in SiteID a local var store for save SITE_ID thread-safe and set it with middleware. It's base on https://djangosnippets.org/snippets/1099/ but with call to local() in SiteID and using custom models for web site and domains.

  • dynamic
  • site_id
  • thread-locals
Read More
Author: jhg
  • 1
  • 0

change SITE_ID on fly

Django SITE_ID is a global setting, so the site framework requires you to run multiple instances of Django; at least one for each site. But i want have one instance for multiple sites. This snippet solve this task by change SITE_ID on fly. /sorry my bad english/

  • settings
  • site_id
  • site-contrib
Read More

3 snippets posted so far.