Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#26312 closed Cleanup/optimization (fixed)

Tutorial Part 5 should warn about possible db errors when running your first test

Reported by: Bob McDonald Owned by: Bob McDonald
Component: Documentation Version: 1.9
Severity: Normal Keywords: tutorial
Cc: django@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: yes UI/UX: no

Description

When you run your first test as instructed in https://docs.djangoproject.com/en/1.9/intro/tutorial05/#running-tests you may run into an error something like Got an error creating the test database: (1044, "Access denied for user 'user'@'host' to database 'test_db_name'"). For a reader not paying close attention, it is easy to miss that django is attempting to create an entirely new database, and the tutorial doesn't mention it. If you had set up a mysql database and user with privileges just for your django database, then you will see this error. It would be good if the tutorial mentioned that django will create a new test database and that if django's mysql connection doesn't have permission to create a new database, you'll need to create one for it and grant the necessary priviledges.

Change History (10)

comment:1 by Tim Graham, 9 years ago

Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

I think I'd rather put the advice in tutorial 2 "Database setup". Since most new users probably use SQLite, it would be nice to avoid another special call out for others where we already have one in tutorial 2 (also it's likely easier to do all your database configuration once). Feel free to submit a patch if you can.

comment:2 by Bob McDonald, 9 years ago

Owner: changed from nobody to Bob McDonald
Status: newassigned

A patch for this is available at https://github.com/UltraBob/django/tree/ticket_26312 I've been reading the docs on contributing, but I'm not sure if I should create a pull request or wait to have these changes reviewed before creating one.

Version 1, edited 9 years ago by Bob McDonald (previous) (next) (diff)

comment:3 by Bob McDonald, 9 years ago

Has patch: set

comment:4 by Moritz Sichert, 9 years ago

Just create a pull request, it's easier to review that way.

comment:5 by Tim Graham, 9 years ago

Patch needs improvement: set

Created a PR and left comments for improvement.

comment:6 by Bob McDonald, 9 years ago

Cc: django@… added

pull request updated based on feedback

Last edited 9 years ago by Bob McDonald (previous) (diff)

comment:7 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: assignedclosed

In b388c294:

Fixed #26312 -- Documented "create database" requirement in tutorial 2.

comment:8 by Tim Graham <timograham@…>, 9 years ago

In e16a0b0:

[1.9.x] Fixed #26312 -- Documented "create database" requirement in tutorial 2.

Backport of b388c294eb5745b3e01dedf0220636fae87ea9a2 from master

comment:9 by Tim Graham <timograham@…>, 9 years ago

In 9ed4a788:

Refs #26312 -- Reworded tutorial 2 to avoid spelling "error".

comment:10 by Tim Graham <timograham@…>, 9 years ago

In 72134a04:

[1.9.x] Refs #26312 -- Reworded tutorial 2 to avoid spelling "error".

Backport of 9ed4a788aa8d6ba6a57a2daa15253c3047048dfb from master

Note: See TracTickets for help on using tickets.
Back to Top