Coder Social home page Coder Social logo

two-scoops-of-django-1.6's People

Contributors

pydanny avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

two-scoops-of-django-1.6's Issues

Page 190: Missing space in section 15.3.3

There should be a space after the first sentence. The first two sentences read:

"The teams behind Google Search and other search engines are very well aware of the growing use of single page apps.In theory some of them are already searching through content rendered by client-side JavaScript."

They should be:

"The teams behind Google Search and other search engines are very well aware of the growing use of single page apps. In theory some of them are already searching through content rendered by client-side JavaScript."

Page 342 typo: "hardware-"

"Load balancers can be hardware- or software-based."

Probably meant to remove the "-" after hardware.

Page 94 - order of logic

This is a nit, but in Example 8.3, it would be better to check permissions before leaking information about presence/absence of a certain sprinkle pk, via the 404.

I'd write:

request = check_sprinkles(request)
sprinkle = get_object_or_404(Sprinkle, pk=pk)

I do accept that this is not the focus of this section, but perhaps this highlights a topic that might be mentioned elsewhere -- preventing probing of address/data spaces, wherever possible. As it happens example 8.4 does not exhibit the leakage, perhaps underlining an additional benefit of CBV - separation of concerns into narrowly defined methods. In this case only permissions testing is needed in the dispatch override. Data access is defined presumably correctly in the superclass, and one would hope the order of operations would be correct (object or 404 only after dispatch()).

1.6 Change List: Chapter Numbers from 30 and on

My copy lists the last chapters as follows:

29 Identical Environments: The Holy Grail
30 Continuous Integration
31 Where and How to Ask Django Questions

But the change list lists Identical Environments as chapter 30, and Continuous Integration as 31.

Missing word on page 72

The last paragraph on page 72 says

Another to remember when using ATOMIC_REQUESTS,โ€ฆ

I imagine that should be

Another thing to remember when using ATOMIC_REQUESTS...

Page 296: missing word

"Second, and this might be unpleasant to hear, but malignant staff can as many problems as any bug or penetration staff."

Missing word, maybe you mean "cause" so "can cause as many...?"

Page 89 typos: "function-" and missing word

Typo 1:
"This concept of change serves as a foundation for all sorts of things you can do with Django views, be they function- or class-based.

Unnecessary "-" after "function."

Typo 2:
"In other words, a callback function that handles the request/response cycle exactly the same manner as a function-based view!"

You're missing a word after "cycle" above. Perhaps "cycle in exactly...?"

Page 43: mentions section 32 (?)

The "TIP: " box on page 43 (section 5.3), mentions "section 32, '12 Factor-Style Settings'". I don't think I see any section numbered 32 in the book.

note by @pydanny: This refers to Appendix E, which without masking shows up as section 32.

Grammar problem on page xxxiii

The first sentence of the "Before you begin" section says:

"If you are new to Django, this book will be helpful large parts will be challenging for you."

Looks like some kind of forgotten edit :-)

Should we remove the custom User model tutorial in the User model chapter?

Considering https://docs.djangoproject.com/en/1.6/topics/auth/customizing/#a-full-example, perhaps we should chop out the similar example in 2SoD 1.6.

My reasoning:

  • It's not a best practice, it's a tutorial. Is it worth repeating or covering with nuance what the Django docs provide for free?
  • What we have nearly duplicates what Django provides.
  • We could add a link to django-auth-tools and other libraries that work with custom user models.
  • We could provide advice on migrating to custom User models from the old profile system.

Additional reasoning from twitter:

  • No overlap. Reference the docs and move on. Being opinionated, if you think you do it better. Put it in the book. (we don't think we can do better)
  • The more you just link to in the book the less people with physical copies will learn wrongly years from now when it's moved on.

Page 238 : Missing word

In Example 19.4

# Only if you installed cookiecutter yet

should be

# Only if you didn't installed cookiecutter yet

Page 107: grammar problem in docstring

One of the docstrings on page 107 (section 9.4.4) says:

"""Returns a dictionary numbers of likes"""

Looks like some word was forgotten or added by mistake

p.26 sec 3.5 Startproject Template

The Startproject Template (when run as described in the instructions) generates a directory structure that contains three levels of icrecreamratings_project which is a bit confusing and isn't as described in the text.

Section 28.4.3 (Ansible) should be expanded

While I know that Chapter 28 is meant to be a "high level overview" of deployment, I think that the section on Ansible could stand to be expanded. Section 28.4.2 (on Salt) is more than a page. Section 28.4.3 is two sentences, one of which is a link to an Appendix in another book which might not be included in the final edition.

On recommending environment variables

In section 5.3 the use of environment variables is recommended to store secrets. However, environment variables can easily be leaked to other processes on the system which makes them less suitable for secret information.

For example, ps axeww lists environment variables for a large number of processes.

Environment variables should only be used if a dedicated user is used for the application and if this application does not start any other unrelated processes because environment variables are leaked to subprocesses.

Having a webserver serve multiple applications is also not easily possible when using environment variables.

It is easier to secure access to a single configuration file with access permissions than to prevent environment variables leaking.

As an alternative, we only have our production settings under revision control on the production environment (separate from development repositories).

Page 29: Grammar

I think that there is a problem with "...given project in available in its...", maybe it should be "...given project available in its..." instead?

INSTALLED_APPS is the list of Django apps used by a given project in available in its INSTALLED_APPS settings.

@pydanny note: This is on page 29, beginning of chapter 4

p.44: Confusion about setting env vars in Windows

The instructions for setting environment variables in Windows are confusing.

  1. The text says that Windows is tricky, but at the end, eventually goes on to recommend the same approach that's mentioned above for Linux and Mac (i.e., add to the end of the activate script). I recommend dropping the "is trickier" because I don't see that (if this was referring to the need to restart the command interpreter, you'd need to do the same thing if modifying .bashrc etc.).

  2. The text says there's an issue with setx but then goes on to use it anyway. Perhaps you meant to use set in the example?

  3. Using setx for secret information makes me nervous because it places the information in the registry (it looks like that's the same for the PowerShell examples). I'm wondering if it might be better to omit all mention of how to store secret information persistently. What do you think?

Page 103: layout

The layout of page 103 (end of section 9.3 and beginning of 9.4) is quite unsightly. A lot of whitespace in the bottom and just one line of content for the section. It would be better to move 9.4 to the next page.

Text styles

Again, a wide-ranging issue, but, only reading up to section 2.2 (and doing vanity skims), I've noticed that you're not consistently constant-width-ing things like loaddata, dumpdata or package names (e.g. django-braces in some places and "django-braces") in others.

Hobgoblin alert.

Page 194: csrftoken in csrf.js is not defined.

The csrf.js misses somehow the cookie extraction for the X-Header of csrf token.
There is this variable that is set for the X-Header "csrftoken" that is not defined. From the django documentation this should be extracted from the cookies. The whole cookie code part is missing in this csrf.js file. This leads could lead into some confusion IMO.

My Proposal is to add the cookie extraction code to this csrf.js file and utilize it in the beginning before the X-Header is set like

var csrftoken = getCookie('csrftoken');

[1] https://docs.djangoproject.com/en/1.6/ref/contrib/csrf/

page 404: Index items bleed into right column

Entries for "django.core.serializers.json.DjangoJSONEncoder, 322" and "django.utils.encoding.python_2_unicode_compatible. 207, 398" bleed from left column into right column.

The former bleeds between "execfile(), 280" and "Explicit Relative Imports, 4-7"; the latter over "Function-BAsed Views, 73, [and so fort]"

Page numbers are broken correctly.

p. xxxiii "Before You Begin" first paragraph

Has:

If you are new to Django, this book will be helpful large parts will be challenging for you.

which should probably be:

If you are new to Django, this bool will be helpful but large parts will be challenging for you.

Should we create a separate index for packages?

The current draft includes material on over 60 Python and Django packages. We've combined them into a single 'Packages' entry in the index as shown below:

screen shot 2014-01-21 at 3 17 02 pm

One significant problem is that this isn't broken up in an easy-to-nagivate way. For example, they are bunched together without distinction between the first letter like the rest of the index is (see next image):

screen shot 2014-01-21 at 3 20 31 pm

Our thought is if we separated general content from packages and made two indexes, it might be easier on the reader.

Advantages:

  • Package Index would be broken out into it's own 'chapter' in the book.
  • Package Index would be broken up into sections by first letter like the current index.

Disadvantages:

  • We already have Appendix A, which lists all the packages in the book (plus bonus ones).
  • Would add about 2 pages.
  • Readers might not find the Package index, or the general index.
  • Would take 1-2 more days of work.

Thoughts?

Page 83: bug in code sample

Page 83, Section 7.3 the topmost code block says:

class TasteListView(DetailView):
 ...

class TasteDetailView(ListView):
  ...

This looks like a bug (or at best, super confusing).

Page 90 typo

"Sometimes we need a one-off views that do tiny things."

  1. Delete the "a" above.

or

  1. "Sometimes we need a one-off view that does tiny things."

Page 183: Missing word?

"It's good practice to abbreviate the urls of your with the version number e.g..."

I believe the word "app" or "project" should go there?

"It's good practice to abbreviate the urls of your #MISSING WORD# with the version number e.g..."

@pydanny note: Occurs in section 14.3.5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.