We load custom environments at startup based on directory from which the app is loaded. The selection could just as easily be based on environment variable, machine name rather than directory path.

The simple trick is to have settings.py serve as a proxy for those other, environment-specific settings files. Values from those settings files are imported into the main settings.py file.

In settings.py:

   env_config = get_my_settings_module_name() # we have a function that
   looks at the path
                                              # of current settings
   file, and picks an appropriate
                                              # environment-specific
   settings file.
                                              #
                                              # Our environments are
   path-based...
                                              # /home/user or
   /Users/user for a developer,
                                              # /our/deploy/path/dev or
   /our/deploy/path/prod for
                                              # deployed apps.
                                              #
                                              # You could just as
   easily key off of an environment
                                              # variable, etc.
                                              #
                                              # This works with both
   Django's dev WSGI server
                                              # and mod_wsgi


   exec("from %s import *" % env_config)      # imports everything from
   your env-specific settings file
                                              # into main settings.py
   for the project.


chiranjeevi muttoju wrote:
we have two applications, what we want to do is, one app should run at one address and other app should run at different address. this is my requirement. is it possible to put those two apps in the same project...?(different apps but same project, we sud be able to run both apps separately with the different settings.)

On Mon, Mar 8, 2010 at 3:39 PM, Atamert Ölçgen <mu...@muhuk.com <mailto:mu...@muhuk.com>> wrote:

    On Monday 08 March 2010 09:06:05 chiranjeevi muttoju wrote:
    > Hi friends,
    > i have two apps in my project, and i want to use two different
    settings for
    > each app. it means same project but i sud run those two apps
    separately. is
    > it possible..? if anyone of u guys know please reply me. And if
    u want any
    > further information regarding this post please ask me.
    No. But if you tell us which settings you want different and why,
    someone
    might offer an alternative solution.


    --
    Saygılarımla,
    Atamert Ölçgen

     -+-
     --+
     +++

    www.muhuk.com <http://www.muhuk.com>
    mu...@jabber.org <mailto:mu...@jabber.org>

    --
    You received this message because you are subscribed to the Google
    Groups "Django users" group.
    To post to this group, send email to django-users@googlegroups.com
    <mailto:django-users@googlegroups.com>.
    To unsubscribe from this group, send email to
    django-users+unsubscr...@googlegroups.com
    <mailto:django-users%2bunsubscr...@googlegroups.com>.
    For more options, visit this group at
    http://groups.google.com/group/django-users?hl=en.




--
Thanks & Regards,
Chiranjeevi.Muttoju
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

<<attachment: rmela.vcf>>

Reply via email to