× Warning! This forum is in archival status. New contributions may not work.
Setting the profile from booktype.env or settings/base.py
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    Hi,

    I noticed that instance-name/settings/base.py contains the setting:

    PROFILE_ACTIVE = 'dev'

    however booktype.env also contains a similar setting:

    export DJANGO_SETTINGS_MODULE=instance-name_site.settings.dev

    If the two settings are different, which setting takes precedence in the case of an instance served by Apache?

    Thanks!

    Daniel

     
    Post edited by Daniel James at 2015-03-16 13:11:44
  • 1 Comment sorted by
  • Hi Daniel,

    DJANGO_SETTINGS_MODULE is used by Django to read the correct settings file. That is the most important configuration setting. You can find it also in manage.py and wsgi.py. 

    For Apache entry point is wsgi.py file, so whatever is defined to be settings there will be important for Apache. Celery workers (built in server, and other management commands used to setup the instance) are started by manage.py, so whatever is defined there is important for them.

    On the other hand PROFILE_ACTIVE is something which is needed if users wants to have some different logic in templates (or code) for different profiles. For instance, on the development machine (or same instance which has switched profiles for a moment) you don't communicate with certain API and on the production machine you do. Things like that. Only custom modifications will use this so it has 0 impact on Apache and other servises.

    Aco