Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#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)

remove_mysite_from_import.diff (4.2 KB ) - added by Keith Gray 14 years ago.
remove_mysite_from_import.2.2.diff (8.3 KB ) - added by Gabriel Hurley 14 years ago.
remove_mysite_from_import.3.diff (10.5 KB ) - added by Keith Gray 14 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 by Paul McMillan, 14 years ago

Triage Stage: UnreviewedAccepted

Seems like a good idea to me.

by Keith Gray, 14 years ago

comment:2 by Keith Gray, 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 Gabriel Hurley, 14 years ago

comment:3 by Gabriel Hurley, 14 years ago

Status: newassigned

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 Keith Gray, 14 years ago

comment:4 by Keith Gray, 14 years ago

Cc: idahogray@… 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 Gabriel Hurley, 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 Gabriel Hurley, 14 years ago

Resolution: fixed
Status: assignedclosed

(In [14270]) Fixed #14426 -- Removed "mysite" import statements from examples that might teach people "bad habits" in regards to creating reusable apps.

comment:7 by Gabriel Hurley, 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.

comment:8 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

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