Code

Opened 22 months ago

Closed 22 months ago

Last modified 22 months ago

#18493 closed Cleanup/optimization (fixed)

Tutorial #2 could better hint where "source code of Django itself" is

Reported by: travisgriggs@… Owned by: nobody
Component: Documentation Version: 1.4
Severity: Normal Keywords:
Cc: florian+django@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

I am working my way through the excellent tutorials. They really are good, and I'm really liking Django already. Everything's gone OK, nothing too show stopping. Until I got to the end of tutorial #2. The part where you're supposed to copy the admin/base_site.html from "source code of Django itself" to your own local directory. The problem is that I'm on OSX and finding where the original was turned into a long and trying search (where I discovered things like SpotLight does not index /Library or a lot of other things).

Assuming it's a python newbie, it would be nice if there was a hint as to where that is on OSX (and a Windows user would probably have the same experience). You dl django, you do the 3 line install, and then jump into the tutorial, but you don't really know/remember/realize at the end of tutorial 2 where in the world those files are.

Attachments (1)

18493.diff (777 bytes) - added by claudep 22 months ago.
Hint to find Django sources

Download all attachments as: .zip

Change History (7)

Changed 22 months ago by claudep

Hint to find Django sources

comment:1 Changed 22 months ago by claudep

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 22 months ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from new to closed

In [c68f4c514c7b1102772b6ea11e9e59c7c87f7fae]:

Fixed #18493 - Added instructions to locate the Django source files to the t

Thanks Claude Paroz for the draft patch.

comment:3 Changed 22 months ago by Tim Graham <timograham@…>

In [32bd77d392e331e823792abcd9d31045f681776d]:

[1.4.X] Fixed #18493 - Added instructions to locate the Django source files to the t

Thanks Claude Paroz for the draft patch.

Backport of c68f4c514c from master

comment:4 Changed 22 months ago by apollo13

  • Cc florian+django@… added

wouldn't a simple python -c "import django; print django" be easier?

comment:5 follow-up: Changed 22 months ago by claudep

The bash line was copied from a similar example committed by Carl recently:

https://github.com/django/django/commit/6ed7d40727f70934df6ab0ac96f5f1c4f01c534f#L0R168

It may be that in the tutorial context, we don't need the sys.path trick? AFAICU, it depends on the probability that we have an uncompressed django download in the current directory...

comment:6 in reply to: ↑ 5 Changed 22 months ago by carljm

Replying to claudep:

It may be that in the tutorial context, we don't need the sys.path trick? AFAICU, it depends on the probability that we have an uncompressed django download in the current directory...

That's exactly correct. In the context of my commit, it's actually very likely the user is in the directory containing Django's setup.py, meaning the simple version will just return the local "django" directory, which is not helpful.

In the tutorial case it may not be quite so likely, but since either way it's a (likely opaque to the user) command we're asking them to copy-paste, I don't see the harm in using the slightly longer version that is more likely to return the answer they are looking for.

I wish Python had a command-line flag to disable adding the current directory to the beginning of sys.path.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.