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

Error with adding authors page 19 and 20 #52

Open
johnscrapetest87 opened this issue Sep 4, 2023 · 0 comments
Open

Error with adding authors page 19 and 20 #52

johnscrapetest87 opened this issue Sep 4, 2023 · 0 comments

Comments

@johnscrapetest87
Copy link

Working thru the example in the book, on pages 19 and 20, when adding the author, I have run in to errors. Please advise.

My system is windows, Windows 10 64bit. My Python is 3.8.9 My Django is 4.2.4

I followed building the blog example exactly word for word from pages 1 thru 19. Everything is fine. At Page 19 you add the author names to the post.

Bottom of page 19 you add : "from django.contrib.auth.models import User" to models.py and on page 20 you add:

author = models.ForeignKey(User, on_delete=models.CASCADE, related_name= 'blog_posts')

(note: If I hashtag out the second line above the web page works fine. So the second statement, added on page 20 is causing the error. Please advise what is causing this and advise a correction for your book for other readers.

John O'Grady

This (page 20) causes an error / exception as shown below when I load the blog site into my browser:

image.png
blog_error_Page20

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

No branches or pull requests

1 participant