Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package used for Flasky API does not include a version number in its name #508

Open
bkline opened this issue Apr 12, 2021 · 8 comments
Open
Labels

Comments

@bkline
Copy link

bkline commented Apr 12, 2021

In chapter 14 of Flask Web Development, 2nd ed., we read

Note how the package used for the API includes a version number in its name.

However the name of the package is api without any version number.

@miguelgrinberg
Copy link
Owner

Yes. This is a change that was made in the repository after publication. While it is okay to use the version number in the package name in most cases it isn't necessary because the version can still be applied in the URL as a prefix, as you can see here: https://github.com/miguelgrinberg/flasky/blob/master/app/__init__.py#L43.

@bkline
Copy link
Author

bkline commented Apr 12, 2021

Ah, in that case I would suggest adding a README.md to the api directory, explaining what you just wrote. A comment in the package's __init__.py wouldn't be a waste of time either. This way, you can dispel confusion which would arise for other readers. You might also want to have the publisher fix the electronic version of the book.

@bkline
Copy link
Author

bkline commented Apr 12, 2021

As I continue reading along in the chapter, I can't help wondering: how did the paths for the chapter's code examples get fixed (to remove the number) if that decision wasn't made until after publication?

@miguelgrinberg
Copy link
Owner

I don't have a copy of the book at hand right now to check. Do you have the 1st or 2nd edition? The first edition used the api_1_0 name (code is here). In the second edition the name changed to api. If there is a reference to api_1_0 in the text of the second edition, then that is an error.

@bkline
Copy link
Author

bkline commented Apr 13, 2021

I have the second edition. This repository matches that edition, so it wouldn't do me much good if I had the first edition. 😉

If there is a reference to api_1_0 in the text of the second edition, then that is an error.

There aren't any. That's why I wrote

... how did the paths for the chapter's code examples get fixed (to remove the number) if that decision wasn't made until after publication?

It's looking more and more as if the decision to change the name of the package, removing the numbers, was made before publication of the second edition, not after. And the sentence I'm reporting in this issue:

Note how the package used for the API includes a version number in its name.

... was actually held over by mistake from the first edition. You're confirming that in your previous comment, it seems:

In the second edition the name changed to api.

I will say that it is very rare these to get to the 14th chapter of a software development book before finding something which didn't make sense. Somewhat reminiscent of the early days of O'Reilly, when their editors were really good. 👍

@miguelgrinberg
Copy link
Owner

Okay, sorry, I think now we are finally on the same page about this. You are correct, that sentence is the only problem, and it is an inadvertent carry over from the 1st edition that needed to be removed. I'll make a correction on the manuscript so that it is fixed the next time the book is printed and or the e-book re-rendered.

@00riddle00
Copy link

Hello,

I have gone through the book with my students and we have made Flasky web app, with minimal changes (e.g. using Bootstrap-Flask package instead of Flask-Bootstrap, pyjwt instead of itsdangerous) to make it work with the newest versions of all the packages used in the project. I can confirm that everything works.

I would like to ask whether there are any plans on the printed 3rd edition of the book? I am about to buy the printed 2nd edition, so I am asking that perhaps I should wait for the 3rd, if it's coming in the near future.

This question was also mentioned in this issue: #440, and as I understand Flask did not yet change in a considerable way.

Thank you for the answer:)

@miguelgrinberg
Copy link
Owner

@00riddle00 If it was up to me, there would already be a 3rd edition out, updated with all latest versions of Flask and all other dependencies. But I do not make this call. The list of changes/updates is fairly small, so the publisher does not consider it worthwhile to create a 3rd edition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants