#23427 closed Cleanup/optimization (fixed)
Doc update to account for runserver behavior when starting project
Reported by: | Patrick Beeson | Owned by: | Patrick Beeson |
---|---|---|---|
Component: | Documentation | Version: | 1.7 |
Severity: | Normal | Keywords: | docs tutorial |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
In 1.7, running runserver before running migrate when creating a new project creates a db file (sqlite by default). This isn't clear in the tutorial docs, and is different behavior than what occurred in previous versions. You'll also get a nasty server error when viewing localhost in your browser.
I propose updating the first tutorial page to account for this to avoid confusing folks new to Django, or new to 1.7 from a previous version.
Change History (12)
comment:1 by , 10 years ago
Easy pickings: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:4 by , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:5 by , 10 years ago
This update looks most appropriate under miscellaneous (https://docs.djangoproject.com/en/1.7/releases/1.7/#miscellaneous) or management commands (https://docs.djangoproject.com/en/1.7/releases/1.7/#management-commands), especially since the latter mentions runserver specifically.
comment:6 by , 10 years ago
I'd go for the first suggestion, since the second is under "Minor Features" which this isn't.
comment:7 by , 10 years ago
If it helps, it's only an issue if you already have a sessionid
cookie for the domain, so it shouldn't be an issue for everyone.
As a side note, probably not possible with just middleware, but it would be nice if the session authentication check was done the first time get_user(request)
is called, instead of every request, as it creates unnecessary session and user queries on pages where user is not used. It would be nice if there were a way to override the get_user(request)
logic to put this check there. That would remove the requirement to have a database before using a runserver for the first time.
An alternative could be to enable signed_cookies by default, as that would also remove the database requirement.
comment:8 by , 10 years ago
Pull request issued for release docs update: https://github.com/django/django/pull/3166
comment:9 by , 10 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:10 by , 10 years ago
Has patch: | set |
---|---|
Triage Stage: | Ready for checkin → Accepted |
"has patch" is the proper state, currently. you shouldn't "ready for checkin" your own patch.
comment:11 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
As discussed in #django-sprint, a mention in the release notes would be fine. Suggested text: "With the addition of the SessionAuthenticationMiddleware to the default project template, a database must be created before accessing a page using runserver."