#14426 closed (fixed)
Factor "mysite" out of all code example import statements
Reported by: | Gabriel Hurley | Owned by: | Gabriel Hurley |
---|---|---|---|
Component: | Documentation | Version: | 1.2 |
Severity: | Keywords: | ||
Cc: | idahogray@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
In the spirit of #14255 it seems like it would be wise to remove the "mysite" (as in from mysite.foo.bar import baz
) wherever it may appear, not just specifically from the tutorial.
There are still ~20 remaining instances of it within docs/intro/
, docs/ref/contrib/
, and docs/topics/
.
There's also a very old reference in docs/releases/0.96.txt
... but touching something that old seems almost sacrilegious ;-)
Attachments (3)
Change History (11)
comment:1 by , 14 years ago
Triage Stage: | Unreviewed → Accepted |
---|
by , 14 years ago
Attachment: | remove_mysite_from_import.diff added |
---|
comment:2 by , 14 years ago
Has patch: | set |
---|
Attached a patch factoring out mysite in import statments from the docs/ directory. I ran
grep -R "from mysite" ./
and looked through all of the results. I only changed the ones that I thought made sense.
by , 14 years ago
Attachment: | remove_mysite_from_import.2.2.diff added |
---|
comment:3 by , 14 years ago
Status: | new → assigned |
---|
Thanks idahogray! I was gonna get to this myself eventually, but your patch was a great start. I added a new patch based on yours that changes a couple more instances that weren't specifically of the "from mysite" sort. If you'd take a look at it and give me a sanity-check then I'd say we can wrap this one up!
by , 14 years ago
Attachment: | remove_mysite_from_import.3.diff added |
---|
comment:4 by , 14 years ago
Cc: | added |
---|
I found a few more, please double check to make sure I didn't remove invalid ones. I used this command to locate them:
grep -Rn --exclude="*\.svn-base" "mysite\." ./
I did not touch anything in howto/deployment, not sure if it also needs attention.
comment:5 by , 14 years ago
I had looked at a number of the items changed in the latest patch, and consciously decided not to change them for the following reason:
On a practical level, you can't really have reusable projects, so it isn't as harmful to include "mysite" in front of project-level modules (e.g. mysite.views, or mysite.urls), and in these cases it would be much more confusing to new users of Django to just see a line like "from views import archive, about, contact
" in the docs. There wouldn't be any clear indication of which "views" we're talking about.
So even though it's perfectly valid to drop the "mysite" from those cases if you know what you're doing, I'm going to intentionally leave them in for the sanity of newbies ;-)
comment:6 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:7 by , 14 years ago
(In [14271]) [1.2.X] Fixed #14426 -- Removed "mysite" import statements from examples that might teach people "bad habits" in regards to creating reusable apps.
Thanks to idahogray for assisting with the patch (and sorry for forgetting the attribution in the patch on trunk).
Backport of [14270] from trunk.
Seems like a good idea to me.