Great, sounds good
On Jan 1, 2014 6:00 AM, "ukanga" <notifications@github.com> wrote:

> In formhub/settings.py:
>
> > @@ -418,3 +419,20 @@ def configure_logging(logger, **kwargs):
> >  MONGO_CONNECTION = MongoClient(
> >      MONGO_CONNECTION_URL, safe=True, j=True, tz_aware=True)
> >  MONGO_DB = MONGO_CONNECTION[MONGO_DATABASE['NAME']]
> > +
> > +try:
> > +    from django.contrib.sites.models import Site
> > +    site = Site.objects.get(pk=SITE_ID)
> > +except Exception, e:
> > +    SITE_NAME = 'example.com'
> > +    print e
> > +else:
> > +    SITE_NAME = site.name
> > +# site templates overrides
> > +TEMPLATE_DIRS = (
>
> SITE_ID is always defined in settings, and the domain and name will be
> set via django admin. SITE_ID can always be changed in in
> local_settings.py, in a multi site environment where each site have their
> own settings file, but share the same database, then SITE_ID = 2, might
> have a different name and domain all together using the same codebase and
> database. One reason I have this piece of code after local_settings.pyimport. Someone can always add the lines in their custom settings file with
> real paths that may not be the same as the site_name, the whole idea was
> to try to make this a little bit generic and especially for those using
> formhub.settings
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/onaio/onadata/pull/76/files#r8605697>
> .
>