Opened 8 years ago

Closed 8 years ago

#27163 closed Uncategorized (wontfix)

Unable to specify multiple pythonpath in django-admin

Reported by: Al Johri Owned by: nobody
Component: Core (Management commands) Version: 1.10
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

I am unable to specify multiple pythonpaths django-admin. This can either be colon separated paths or specifying the pythonpath parameter multiple times.

please see this pull request for colon separated paths: https://github.com/django/django/pull/7189

Change History (3)

comment:1 by Tim Graham, 8 years ago

I don't understand why the --pythonpath option was added in the first place (#357). Is there some reason PYTHONPATH=$PYTHONPATH:... doesn't work? Is it just more verbose? Regarding your use case, I'd like to encourage best practices and that doesn't really seem like a pattern to encourage.

comment:2 by Al Johri, 8 years ago

Yeah, that makes sense.

It was a pretty weird reason to need the parameter. I was sourcing a bash script that set my PYTHONPATH and other environment variables when developing locally. I tried doing the same thing when moving to docker via docker-compose run myapp source myscript && django-admin dbshell --settings=myapp.settings but apparently you can't do that. So my next option was docker-compose run myapp django-admin dbshell --settings=myapp.settings --pythonpath="lib:admin". After submitting that PR, I realized I could just set PYTHONPATH as an environment variable in docker-compose like a normal person and that solved my issue.

comment:3 by Al Johri, 8 years ago

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