I wouldn't recommend using this method, I did this previously for several
months, and quickly switched to an alternative (which I mentioned in my
previous post).

Generally speaking, keeping anything outside of the version control is just
not a good idea, unless it's a tmpfs, a sock dir, or autonomously managed
data store.

As for never having to type --settings, with the solution I mentioned
before, you'd just have to prepend commands with DJANGO_ENVIRONMENT=dev or
prod.  (e.g. DJANGO_ENVIRONMENT=dev ./manage.py shell). You can shorten the
name if you are really lazy (DE=dev or w/e).

I really would not recommend trying to do any sort of automatic environment
detection, this can lead to many many tears being shed. The command line is
brutal and heartless, no matter if your a newbie or a seasoned pro.

On Mon, Mar 7, 2011 at 9:13 PM, Shawn Milochik <sh...@milochik.com> wrote:

> The easiest solution I've found:
>
>    1. Create a file named local_settings.py that is *outside* of
> version control.
>
>    2. Import local_settings at the bottom of settings.py, handling
> the exception if it doesn't exist.
>
>    3. Override anything you like in local_settings.py.
>
> This has these advantages:
>
>    1. You don't need to pass the --settings value when running
> manage.py commands.
>
>    2. You *never* have to change settings in your dev environment
> (like DEBUG) -- leave them in "development mode."
>
>    3. You have your production settings documented in the "official"
> settings.py.
>
>    4. You never have to remember which settings file to use in which
> circumstances -- it's always the default.
>
> Shawn
>
> --
> 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.
> 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-users@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.

Reply via email to