twoscoops / two-scoops-of-django-1.11

The issue tracker, changelog, and code repository for Two Scoops of Django 1.11

Home Page:https://www.twoscoopspress.com/products/two-scoops-of-django-1-11

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Settings directory inconsistency

nathanhinchey opened this issue · comments

Location within the Book

Directory structure:

  • Chapter or Appendix: Chapter 3 (How to Lay Out Django Projects)
  • Section: Section 3.2 (Our Preferred Project Layout)
  • Subsection: Example 3.2.3 (Second Level: Configuration Root)

Terminal command:

  • Chapter or Appendix: Chapter 5 (Settings and Requirement Files)
  • Section: Section 5.2 (Using Multiple Settings Files)
  • Subsection: Example 5.2 (Local Settings Shell)

Description

In the directory structure given in 3.2.3, it is specified that the settings module should be within the config directory.

The <configuration_root> directory is where settings module and base URLCong (urls.py) are placed.

But this command for how to run the shell using local settings assumes that this directory is instead in the django project directory.

python manage.py shell --settings=twoscoops.settings.local

As far as I can find, there is nowhere in the book where it is specified that the settings module should be in the django project directory.

I was confused about this also

I believe this should read

python manage.py shell --settings=config.settings.local

The cookiecutter template may help to clarify

edit: copy/paste laziness.

@hugodes I agree. I set up my directory the way described, and testing it it appears that config.settings.local is correct.

Thanks for the catch @nathanhinchey! 🚢 🍨 You'll be given mention in the acknowledgements of the next edition to be released on May 11!

https://www.feldroy.com/products/two-scoops-of-django-3-x