Code

Opened 3 years ago

Closed 19 months ago

#17058 closed Bug (fixed)

Docs refer to extras/csrf_migration_helper.py which is not packaged

Reported by: slinkp Owned by: nobody
Component: Documentation Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

There is a script called extras/csrf_migration_helper.py that is recommended by both the 1.3 and dev docs:
https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#how-to-use-it
and
https://docs.djangoproject.com/en/1.3/ref/contrib/csrf/#how-to-use-it

However, the only way to get that script is by checking out django from SVN. It's not anywhere in the 1.3 release.

Either that script should be included in releases, or the docs should be changed to tell you to get it from svn, or something.

Attachments (0)

Change History (6)

comment:1 Changed 3 years ago by lukeplant

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

I checked both the 1.3 and 1.3.1 tarballs from https://www.djangoproject.com/download/ and the script is indeed there, in the 'extras' directory as described. Perhaps you are experiencing some downstream packaging bug?

comment:2 Changed 3 years ago by slinkp

I see what's happening. The file is included in the tarball, but because it is not under the django/ directory, setuptools doesn't consider it part of the django package. So if you install django via easy_install or pip (which I typically do), you will never see that file.

$ virtualenv temp
$ cd temp
$ source bin/activate
$ pip install django==1.3.1
Downloading/unpacking django
...
$ find . -name csrf_migration_helper.py
$

I still think that's a problem.

comment:3 Changed 3 years ago by lukeplant

I don't think there is a way we can fix this, because there is no place for it to live. It doesn't belong inside the django namespace, and certainly not in a new 'extras' namespace.

Since csrf_migration_helper.py is only intended for use at development time, and as a one off, it doesn't need to be on a production machine, and falls under the category of something that is nice to have during development. This makes it essentially the same as docs, and pip/setuptools doesn't install docs either, or any other items under 'extras' which are also useful things to have offline.

We could possibly add it to 'scripts', but I don't think it is nice to litter the system PATH with something that is used at development time only, and is going to be used so rarely - once per project, really.

I believe the '-d' option to pip or the '--editable' option for easy_install should get you the full source tarball.

comment:4 Changed 3 years ago by slinkp

I think I would be happy if the docs just made some mention of "where is extras".

comment:5 Changed 3 years ago by carljm

  • Resolution invalid deleted
  • Status changed from closed to reopened
  • Triage Stage changed from Unreviewed to Accepted
  • Version changed from 1.3 to SVN

I agree with Luke that these extras scripts shouldn't be installed, but I agree with the OP that the documentation references to such scripts should be clearer about where they can (and can't) be found.

comment:6 Changed 19 months ago by Tim Graham <timograham@…>

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

In 15202baace1453e7576806f13d137ae930de6dcb:

Fixed #17058 - Clarified where extras/csrf_migration_helper.py is located

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.