Dear Russell,

thanks -- brilliant advice!

Greetings from Copenhagen,

David


On 09/03/14 01:10, Russell Keith-Magee wrote:
> 
> On Sun, Mar 9, 2014 at 5:09 AM, David <ld...@gmx.net
> <mailto:ld...@gmx.net>> wrote:
> 
>     Dear list,
> 
>     I follow
>     http://www.tangowithdjango.com/book/chapters/templates_static.html
> 
>     The book instructs me to insert a SETTINGS_DIR and PROJECT_PATH
>     variables in my project settings.py.
>     However, the automatically created settings.py already contains a line
> 
>     BASE_DIR = os.path.dirname(os.path.dirname(__file__))
> 
>     that looks very similar to the next three lines I added.
> 
>     Am I reproducing code here? Do I make a mistake if I take the BASE_DIR~
>     line out?
> 
>     Thanks for your guidance!
> 
> 
> Ultimately, it won't really matter, as long as the final paths a
> complete and correct.
> 
> I'm not sure which version of Django "Tango with Django" was originally
> written with, but if it was written pre-1.6, then their advice was
> completely sound. Django 1.5 and earlier didn't have a BASE_DIR in the
> settings file, and it was very common to suggest users put a "project"
> directory in their settings file to make it easier to move code around.
> 
> Django 1.6 added BASE_DIR, giving the general pattern a standardised name.
> 
> As long as your own settings file is internally consistent, you'll be fine. 
> 
> If you want to have all three settings, you can do that; it will be
> microscopically less computationally efficient (since it will be
> computing the directory three times), but your settings files might be
> easier to read.
> 
> If you want to delete all references to BASE_DIR, that's fine, as long
> as you update all settings that reference BASE_DIR.
> 
> Alternatively, if you delete all references to SETTINGS_DIR and/or
> PROJECT_PATH, that's fine too - as long as you don't have any settings
> or code referring to them.
> 
> In the extreme case - you can delete all three, and replace them with
> hardcoded path strings.
> 
> If you're following the tutorial, it will probably be easier to stick
> with the SETTINGS_DIR/PROJECT_PATH pair, because the tutorial code will
> be referencing those settings. However, there's nothing magical about
> those two names; they're just shortcuts to make it easier to construct
> paths in your settings files.
> 
> Yours,
> Russ Magee %-)
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscr...@googlegroups.com
> <mailto:django-users+unsubscr...@googlegroups.com>.
> To post to this group, send email to django-users@googlegroups.com
> <mailto:django-users@googlegroups.com>.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJxq849mxgCRyNPDeUuCB-ghjd4f8zDO-AKFbEd%3DTJ_A7FL8fQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAJxq849mxgCRyNPDeUuCB-ghjd4f8zDO-AKFbEd%3DTJ_A7FL8fQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/531C5AE7.9030101%40gmx.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to