Opened 9 years ago

Closed 3 years ago

#5936 closed Bug (fixed)

django-admin's shell --plain command doesn't respect PYTHONSTARTUP or .pythonrc settings

Reported by: Todd O'Bryan Owned by: nobody
Component: Core (Management commands) Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

I think the check about whether or not the user specified the --plain option on the command line is unnecessary.

Attachments (1)

pythonstartup.patch (1.4 KB) - added by Todd O'Bryan 9 years ago.

Download all attachments as: .zip

Change History (10)

Changed 9 years ago by Todd O'Bryan

Attachment: pythonstartup.patch added

comment:1 Changed 9 years ago by Todd O'Bryan

See the discussion at:

http://groups.google.com/group/django-developers/browse_thread/thread/8abc0b31323edfc4#

It turns out that, at least on Ubuntu, /etc/profile gets ignored, so that's why PYTHONSTARTUP didn't get used even when I didn't specify --plain. I still think it's the case that, even if --plain is used, the command should still try to load PYTHONSTARTUP and .pythonrc because that's what "plain" old python would do.

comment:2 Changed 9 years ago by Todd O'Bryan

Summary: django-admin's shell command doesn't respect PYTHONSTARTUP or .pythonrc settingsdjango-admin's shell --plain command doesn't respect PYTHONSTARTUP or .pythonrc settings

comment:3 Changed 9 years ago by Simon G <dev@…>

Triage Stage: UnreviewedDesign decision needed

comment:4 Changed 6 years ago by Gabriel Hurley

Severity: Normal
Type: Bug

comment:5 Changed 5 years ago by Carl Meyer

Easy pickings: unset
Triage Stage: Design decision neededAccepted
UI/UX: unset

Given that that "django-admin.py help shell" describes --plain simply as "use plain Python, not IPython", and plain Python normally would respect .pythonrc and PYTHONSTARTUP, it does seem like this ought to be changed so --plain still loads those files.

comment:6 Changed 4 years ago by Jannis Leidel

Needs documentation: set
Patch needs improvement: set

comment:7 Changed 4 years ago by Aymeric Augustin

Component: Core (Other)Core (Management commands)

comment:8 Changed 3 years ago by andrewjesaitis

comment:9 Changed 3 years ago by Marc Tamlyn

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top